From 8c0d29fee988928d2ce439b7a5f772e1cda62060 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 12 Feb 2013 19:05:10 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/GVN.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.34.1