[PATCH] D55262: [OpenCL] Fix for TBAA information of pointer after addresspacecast

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 6 10:16:00 PST 2018


rjmccall added a comment.

In D55262#1321641 <https://reviews.llvm.org/D55262#1321641>, @romanovvlad wrote:

> Yes it's 1, but after addrspacecast alignment becomes not struct A but alignment of the pointer


Oh!  Yes, that's even more broken than I thought.



================
Comment at: lib/CodeGen/CGExpr.cpp:4272
         *this, LV.getPointer(), E->getSubExpr()->getType().getAddressSpace(),
         DestTy.getAddressSpace(), ConvertType(DestTy));
+    return MakeAddrLValue(Address(V, LV.getAddress().getAlignment()),
----------------
This call to `getAddressSpace()` doesn't look right: we just constructed `DestTy` as an unqualified pointer type.  It needs to be `E->getType().getAddressSpace()`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55262/new/

https://reviews.llvm.org/D55262





More information about the cfe-commits mailing list