[PATCH] Fix assert with copy from global through addrspacecast

Michele Scandale michele.scandale at gmail.com
Fri Nov 22 14:01:01 PST 2013



================
Comment at: lib/IR/Constants.cpp:1510
@@ +1509,3 @@
+  return getBitCast(S, Ty);
+}
+
----------------
Matt Arsenault wrote:
> Michele Scandale wrote:
> > Maybe this function can be fused within getPointerCast in order to support there the case of pointers with different address spaces.
> I tried that originally, but the results weren't satisfying. The asserts are different since getBitCastOrAddrSpaceCast only accepts pointer<->pointer casts, while getPointerCast accepts integer destinations.
That's ok, IMHO a more general name would be better (like getPointerToPointerCast).

However, the getPointerCast must be fixed in order to create the proper cast also when the destination type has a different address space with respect to the source Constant.


http://llvm-reviews.chandlerc.com/D2205



More information about the llvm-commits mailing list