[PATCH] Address Space Casting

Michele Scandale michele.scandale at gmail.com
Mon Nov 11 02:45:54 PST 2013

Comment at: lib/IR/AutoUpgrade.cpp:458-461
@@ +457,6 @@
+  Type *SrcTy = V->getType();
+  if (SrcTy->isPointerTy() && DestTy->isPointerTy() &&
+      SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace()) {
+    LLVMContext &Context = V->getContext();
+    // We have no information about target data layout, so we assume that
Matt Arsenault wrote:
> This won't work for vectors of pointers
I haven't considered vector of pointers as supported types: such test is used also in other places of this patch.

Do you think this case (e.g. <4 x i32*>  -->  <4 x i32 addrspace(1)*>) should be handled by addrspacecast instruction? In this case I'll update the patch asap.


More information about the llvm-commits mailing list