diff options
author | Dan Gohman <dan433584@gmail.com> | 2013-02-12 19:05:10 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2013-02-12 19:05:10 +0000 |
commit | 8c0d29fee988928d2ce439b7a5f772e1cda62060 (patch) | |
tree | 98aefcad5fd9238b12e1a0739f3c9ff105917770 | |
parent | b97c14b68f7ebbe6cae673851a6c3f81d639e251 (diff) |
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
-rw-r--r-- | lib/Transforms/Scalar/GVN.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp index 0fe10960cc..ff55f6fc2f 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; |