[PATCH] Canonicalize addrspacecast ConstExpr between different pointer types

Jingyue Wu jingyue at google.com
Fri Jun 13 14:48:26 PDT 2014


================
Comment at: test/CodeGen/NVPTX/access-non-generic.ll:78
@@ -79,1 +77,3 @@
+; When hoisting an addrspacecast between different pointer types, replace the
+; addrspacecast with a bitcsat.
 define i32 @ld_int_from_float() {
----------------
Mark Heffernan wrote:
> spelling nit: bitcast.
Will fix

================
Comment at: test/CodeGen/NVPTX/access-non-generic.ll:81
@@ -80,3 +80,3 @@
 ; IR-LABEL: @ld_int_from_float
-; IR: addrspacecast
+; IR: bitcast
 ; PTX-LABEL: ld_int_from_float(
----------------
Mark Heffernan wrote:
> Is there also an addrspacecast that you could/should check for?  It's more of a question than a request.
nvptx-favor-non-generic will fold the addrspacecast into the load, so what's after the bitcast will be something like:

load i32 addrspace(3)* %1

I'll check for this addrspace-equipped load in the test as well. Thanks!

http://reviews.llvm.org/D4138






More information about the llvm-commits mailing list