When disabling PRE for a value is directly redundant with itself

(through a loop), don't continue to iterate through the reamining
predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2013-02-12 19:05:10 +00:00
parent b97c14b68f
commit 8c0d29fee9

View 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;