[PATCH] D11577: Reassociate: Implement isUnmovableInstruction() without a hardcoded list

David Majnemer david.majnemer at gmail.com
Tue Jul 28 19:03:46 PDT 2015


majnemer added inline comments.

================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:278
@@ -297,3 +277,3 @@
     for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
-      if (isUnmovableInstruction(I))
+      if (I->mayReadOrWriteMemory() || !isSafeToSpeculativelyExecute(I))
         ValueRankMap[&*I] = ++BBRank;
----------------
Would it make sense to extract this logic into a hypothetical `mayBeControlDependent` ?


Repository:
  rL LLVM

http://reviews.llvm.org/D11577







More information about the llvm-commits mailing list