[PATCH] [NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast

Mark Heffernan meheff at google.com
Thu May 28 09:51:02 PDT 2015


LGTM


================
Comment at: lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp:32
@@ -30,1 +31,3 @@
+//   %2 = addrspacecast i32 addrspace(3)* %1 to i32*
+//   %3 = load i32* %2 ; still emits ld.f32, but will be optimized shortly
 //
----------------
 still emits ld.u32?

================
Comment at: lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp:187
@@ +186,3 @@
+  // That hoistAddrSpaceCastFrom succeeds implies BC's source operand has been
+  // replaced with an eliminable addrspacecast.
+  assert(isEliminableAddrSpaceCast(BC->getOperand(0)));
----------------
BC's source operand could have started out as an addrspace cast, right?  That is, it wasn't necessarily replaced.

================
Comment at: lib/Target/NVPTX/NVPTXFavorNonGenericAddrSpaces.cpp:222
@@ +221,3 @@
+  // Limit the depth to prevent this recursive function from running too long.
+  static const int MaxDepth = 20;
+  if (Depth >= MaxDepth)
----------------
This doesn't need to be static.

http://reviews.llvm.org/D10074

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






More information about the llvm-commits mailing list