[Beignet] [PATCH] GBE: fix an potential assertion in constant expanding pass.

Song, Ruiling ruiling.song at intel.com
Thu Apr 2 22:54:49 PDT 2015


LGTM. Yes, it is OK to not use the extra decrement operation.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Friday, April 03, 2015 7:26 AM
> To: beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH] GBE: fix an potential assertion in constant
> expanding pass.
> 
> Using the inserPos is good enough. If using --insertPos, there is one potential
> issue when the insertPos is the head of a list then it will trigger an assertion.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  backend/src/llvm/ExpandConstantExpr.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/backend/src/llvm/ExpandConstantExpr.cpp
> b/backend/src/llvm/ExpandConstantExpr.cpp
> index 2da765e..5c5934a 100644
> --- a/backend/src/llvm/ExpandConstantExpr.cpp
> +++ b/backend/src/llvm/ExpandConstantExpr.cpp
> @@ -120,7 +120,7 @@ static Value *expandConstantVector(Instruction
> *InsertPt, ConstantVector *CV) {
>    Type *IntTy = IntegerType::get(CV->getContext(), 32);
> 
>    BasicBlock::iterator InsertPos(InsertPt);
> -  IRBuilder<> IRB(--InsertPos);
> +  IRBuilder<> IRB(InsertPos);
>    Value *vec = UndefValue::get(CV->getType());
>    for (int i = 0; i < elemNum; i++) {
>      Value *idx = ConstantInt::get(IntTy, i);
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list