aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2007-06-21 01:59:05 +0000
committerOwen Anderson <resistor@mac.com>2007-06-21 01:59:05 +0000
commit58e087b6e30aa9e0228ef1f49c31770aa1141161 (patch)
treecd713931f7bd819763dedd1225924914d3d163f4 /lib/Transforms
parent9cb56014ce3013a39af51bdc060ff154f56e7c91 (diff)
Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/GVNPRE.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp
index ef70f679bc..b1b096e350 100644
--- a/lib/Transforms/Scalar/GVNPRE.cpp
+++ b/lib/Transforms/Scalar/GVNPRE.cpp
@@ -887,13 +887,9 @@ bool GVNPRE::buildsets_anticin(BasicBlock* BB,
// However, for opaques, such as constants within PHI nodes, it is
// possible that they have not yet received a number. Make sure they do
// so now.
- uint32_t valNum = 0;
- if (isa<BinaryOperator>(*I) || isa<CmpInst>(*I))
- valNum = VN.lookup(*I);
- else
- valNum = VN.lookup_or_add(*I);
- if (find_leader(anticIn, valNum) == 0)
- val_insert(anticIn, *I);
+ if (!isa<BinaryOperator>(*I) && !isa<CmpInst>(*I))
+ VN.lookup_or_add(*I);
+ val_insert(anticIn, *I);
}
clean(anticIn);