[Beignet] [PATCH] GBE: Fix a bug in legalize pass.

Zhigang Gong zhigang.gong at linux.intel.com
Thu Feb 5 21:39:50 PST 2015


LGTM, will push latter, thanks.

On Thu, Feb 05, 2015 at 02:22:21PM +0800, Ruiling Song wrote:
> The type may be float.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/llvm/ExpandLargeIntegers.cpp |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/backend/src/llvm/ExpandLargeIntegers.cpp b/backend/src/llvm/ExpandLargeIntegers.cpp
> index 5b620fc..2743cb1 100644
> --- a/backend/src/llvm/ExpandLargeIntegers.cpp
> +++ b/backend/src/llvm/ExpandLargeIntegers.cpp
> @@ -332,7 +332,7 @@ static Value *buildVectorOrScalar(ConversionState &State, IRBuilder<> &IRB, Smal
>      Value * vec = NULL;
>      unsigned ElemNo = Elements.size();
>      Type *ElemTy = Elements[0]->getType();
> -    bool KeepInsert = isLegalBitSize(ElemTy->getIntegerBitWidth() * ElemNo);
> +    bool KeepInsert = isLegalBitSize(ElemTy->getPrimitiveSizeInBits() * ElemNo);
>      for (unsigned i = 0; i < ElemNo; ++i) {
>        Value *tmp = vec ? vec : UndefValue::get(VectorType::get(ElemTy, ElemNo));
>        Value *idx = ConstantInt::get(IntTy, i);
> @@ -459,8 +459,8 @@ static void convertInstruction(Instruction *Inst, ConversionState &State,
>  
>        TypePair OpTys = getExpandedIntTypes(LargeTy);
>        Value *Lo, *Hi;
> -      unsigned LowNo = OpTys.Lo->getIntegerBitWidth() / ElemTy->getIntegerBitWidth();
> -      unsigned HighNo = OpTys.Hi->getIntegerBitWidth() / ElemTy->getIntegerBitWidth();
> +      unsigned LowNo = OpTys.Lo->getIntegerBitWidth() / ElemTy->getPrimitiveSizeInBits();
> +      unsigned HighNo = OpTys.Hi->getIntegerBitWidth() / ElemTy->getPrimitiveSizeInBits();
>  
>        SmallVector<Value *, 16> LoElems;
>        for (unsigned i = 0; i < LowNo; ++i)
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list