aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2013-02-12 19:05:10 +0000
committerDan Gohman <dan433584@gmail.com>2013-02-12 19:05:10 +0000
commit8c0d29fee988928d2ce439b7a5f772e1cda62060 (patch)
tree98aefcad5fd9238b12e1a0739f3c9ff105917770 /lib/Transforms/Scalar/GVN.cpp
parentb97c14b68f7ebbe6cae673851a6c3f81d639e251 (diff)
downloadexternal_llvm-8c0d29fee988928d2ce439b7a5f772e1cda62060.zip
external_llvm-8c0d29fee988928d2ce439b7a5f772e1cda62060.tar.gz
external_llvm-8c0d29fee988928d2ce439b7a5f772e1cda62060.tar.bz2
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
Diffstat (limited to 'lib/Transforms/Scalar/GVN.cpp')
-rw-r--r--lib/Transforms/Scalar/GVN.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 0fe1096..ff55f6f 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;