[Beignet] [PATCH] Fix getting bitwidth of PointerType of LLVM.
Yang, Rong R
rong.r.yang at intel.com
Wed Nov 30 08:28:06 UTC 2016
LGTM, pushed, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> yan.wang at linux.intel.com
> Sent: Friday, November 18, 2016 15:44
> To: beignet at lists.freedesktop.org
> Cc: Yan Wang <yan.wang at linux.intel.com>
> Subject: [Beignet] [PATCH] Fix getting bitwidth of PointerType of LLVM.
>
> From: Yan Wang <yan.wang at linux.intel.com>
>
> PointerType could not be forced to IntegerTyoe for getting bitwidth.
> With Rong's comments, use getTypeBitSize() instead of
> Type::getIntegerBitWidth().
> ---
> backend/src/llvm/llvm_gen_backend.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp
> b/backend/src/llvm/llvm_gen_backend.cpp
> index 397c721..d6b0665 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -1366,7 +1366,7 @@ namespace gbe
> }
> Builder.SetInsertPoint(cast<Instruction>(theUser));
>
> - Type *ptyTy = IntegerType::get(ptr->getContext(), ptr->getType()-
> >getIntegerBitWidth());
> + Type *ptyTy = IntegerType::get(ptr->getContext(),
> + getTypeBitSize(unit, ptr->getType()));
> Value *v1 = Builder.CreatePtrToInt(pointerOp, ptyTy);
>
> Value *v2 = Builder.CreatePtrToInt(getSinglePointerOrigin(pointerOp),
> ptyTy);
> --
> 2.7.4
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list