[PATCH] D32248: CodeGen: Cast alloca to expected address space

Tony Tye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 14:12:22 PDT 2017

t-tye added inline comments.

Comment at: lib/CodeGen/CGDecl.cpp:1115
+  if (AddrTy->getAddressSpace() != ExpectedAddrSpace &&
+      Ty.getAddressSpace() != LangAS::opencl_constant) {
+    address = Address(Builder.CreateAddrSpaceCast(Addr,
Anastasia wrote:
> Do you need to check this? I thought your change doesn't affect OpenCL because alloca AS == private AS in OpenCL  and constant AS local objects are treated as private const objects anyways.
Given patch D32977 that makes function local variables marked with the constant address space treated as static, will they ever be processed by this function now? If so then the extra test for opencl_constant would not be needed.


More information about the cfe-commits mailing list