[PATCH] D14584: [CodeGenPrepare] Create more extloads and fewer ands

Geoff Berry via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 13:54:19 PST 2015


gberry marked 8 inline comments as done.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4242
@@ +4241,3 @@
+    if (cast<Instruction>(LoadUser)->getParent() == Load->getParent() &&
+        !dyn_cast<PHINode>(LoadUser))
+      return false;
----------------
I don't think your comment about the user not being a phi in the same block is correct.  Consider a single block loop where a load inside the loop feeds a phi at the top of the loop.  I've added a test case for this (see test/Transforms/CodeGenPrepare/AArch64/free-zext.ll test_free_zext3).

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:4308
@@ +4307,3 @@
+    }
+  }
+
----------------
I tried to add more of an explanation here, let me know if it makes sense, or if you think this is a shortcoming in the AArch64 back-end that needs to be addressed.

================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:5061
@@ -4878,1 +5060,3 @@
+      Modified |= optimizeMemoryInst(I, I->getOperand(0), LI->getType(), AS);
+      return Modified;
     }
----------------
I went ahead and removed this, though I'm not 100% happy with it.  I would like to avoid doing this work for targets that don't support any extloads at all (since it is wasted computation), but I couldn't find a good way of checking for that, so I was using enableExtLdPromotion as a proxy.


http://reviews.llvm.org/D14584





More information about the llvm-commits mailing list