[llvm] r174994 - When disabling PRE for a value is directly redundant with itself

Dan Gohman dan433584 at gmail.com
Tue Feb 12 11:05:10 PST 2013


Author: djg
Date: Tue Feb 12 13:05:10 2013
New Revision: 174994

URL: http://llvm.org/viewvc/llvm-project?rev=174994&view=rev
Log:
When disabling PRE for a value is directly redundant with itself
(through a loop), don't continue to iterate through the reamining
predecessors.

Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=174994&r1=174993&r2=174994&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Tue Feb 12 13:05:10 2013
@@ -2455,7 +2455,9 @@ bool GVN::performPRE(Function &F) {
           PREPred = P;
           ++NumWithout;
         } else if (predV == CurInst) {
+          /* CurInst dominates this predecessor. */
           NumWithout = 2;
+          break;
         } else {
           predMap[P] = predV;
           ++NumWith;





More information about the llvm-commits mailing list