[PATCH] Address Space Casting
Matt Arsenault
Matthew.Arsenault at amd.com
Mon Nov 11 11:41:18 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
----------------
Michele Scandale wrote:
> 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.
Yes, essentially every other instruction that handles pointers also handles vectors of pointers.
http://llvm-reviews.chandlerc.com/D1401
More information about the llvm-commits
mailing list