[PATCH] Add NVPTXLowerAlloca pass to convert alloca'ed memory to local address

Jingyue Wu jingyue at google.com
Wed Jun 17 12:16:39 PDT 2015


LGTM with some minors


================
Comment at: lib/Target/NVPTX/NVPTXLowerAlloca.cpp:14
@@ +13,3 @@
+//   %A = alloca i32
+//   store i32 0, i32* %A
+//
----------------
; emits st.u32

just to show the difference from the optimized version

================
Comment at: lib/Target/NVPTX/NVPTXLowerAlloca.cpp:81
@@ +80,3 @@
+            UI != UE; ) {
+        // Check Load, Store, GEP Uses on alloca and make them use the
+        // converted generic address, in order to expose non-generic
----------------
"Check Load, Store, GEP and BitCast Uses"

================
Comment at: lib/Target/NVPTX/NVPTXLowerAlloca.cpp:83
@@ +82,3 @@
+        // converted generic address, in order to expose non-generic
+        // addrspacecast to NVPTXFavorNonGenericAddrSpace. For other type
+        // of instructions this is unecessary and may introduce redudant
----------------
"For other types"

================
Comment at: lib/Target/NVPTX/NVPTXTargetMachine.cpp:173
@@ -169,3 +172,3 @@
   addPass(createNVPTXFavorNonGenericAddrSpacesPass());
   // NVPTXLowerKernelArgs emits alloca for byval parameters which can often
   // be eliminated by SROA. We do not run SROA right after NVPTXLowerKernelArgs
----------------
The first part of this comment still makes sense, right?

http://reviews.llvm.org/D10483

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list