When disabling PRE for a value is directly redundant with itself
authorDan Gohman <dan433584@gmail.com>
Tue, 12 Feb 2013 19:05:10 +0000 (19:05 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 12 Feb 2013 19:05:10 +0000 (19:05 +0000)
(through a loop), don't continue to iterate through the reamining
predecessors.

llvm-svn: 174994

llvm/lib/Transforms/Scalar/GVN.cpp

index 0fe1096..ff55f6f 100644 (file)
@@ -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;