[PATCH] [InstCombine] Fold endian-independent load sequence into a single load.

hfinkel at anl.gov hfinkel at anl.gov
Wed Oct 22 08:19:28 PDT 2014


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2068
@@ +2067,3 @@
+  LoadInst *LoadI = dyn_cast<LoadInst>(LoadV);
+  if (!LoadI || !LoadI->isSimple() ||
+      LoadI->getType() != Type::getInt8Ty(LoadI->getContext()))
----------------
As you require these loads to all be in the same block and the initial instruction when you scan later, why don't you get the load's parent block here and bail out earlier?

================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2210
@@ +2209,3 @@
+    // Bail if we found a write, don't even try to be smart about it.
+    if (BBI->mayWriteToMemory())
+      return nullptr;
----------------
Okay, but why not be smart? Making an AA query is easy.

http://reviews.llvm.org/D5898






More information about the llvm-commits mailing list