From: Dan Gohman Date: Tue, 12 Feb 2013 19:05:10 +0000 (+0000) Subject: When disabling PRE for a value is directly redundant with itself X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8c0d29fee988928d2ce439b7a5f772e1cda62060;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 0fe10960cc7..ff55f6fc2f2 100644 --- a/lib/Transforms/Scalar/GVN.cpp +++ b/lib/Transforms/Scalar/GVN.cpp @@ -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;