[PATCH] Address Space Casting
Michele Scandale
michele.scandale at gmail.com
Tue Sep 3 15:01:28 PDT 2013
================
Comment at: lib/IR/AutoUpgrade.cpp:404
@@ +403,2 @@
+ return Opc;
+}
----------------
Eli Friedman wrote:
> This isn't appropriate: this transformation changes the semantics of the code. bitcast is explicitly not equivalent to addrspacecast; it's equivalent to a ptrtoint+inttoptr pair.
>From what have been discussed before (http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-August/064674.html) seems that before bitcast was used to convert two pointers between different address spaces... That's the reason for that code....
================
Comment at: docs/LangRef.rst:5708
@@ +5707,3 @@
+ %X = bitcast i32* %x to addrspace(1) i32* ; yields addrspace(1) i32*:%x
+ %Y = bitcast addrspace(1) <2 x i32>* %y to addrspace(2) i64* ; yields addrspace(2) i32*:%y
+
----------------
Eli Friedman wrote:
> Might want to double-check this. :)
Argh.... I forgot to change the operation
http://llvm-reviews.chandlerc.com/D1401
More information about the llvm-commits
mailing list