diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:29:57 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:29:57 +0000 |
commit | 9e855c68325d51783e317ebdb33aacc0505f3354 (patch) | |
tree | cc56f8d36b815a3749437f2d6e3df0f77d31a33a /llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp | |
parent | 5f6815980b7eeecc96f1e4e89f0fc8c0ffd19f2b (diff) | |
download | bcm5719-llvm-9e855c68325d51783e317ebdb33aacc0505f3354.tar.gz bcm5719-llvm-9e855c68325d51783e317ebdb33aacc0505f3354.zip |
bug 122:
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass
llvm-svn: 14946
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp index aeeade40cce..9738879e282 100644 --- a/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp +++ b/llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp @@ -243,7 +243,7 @@ namespace { void BuildRankMap(Function &F); unsigned getRank(Value *V) const { - if (isa<Constant>(V) || isa<GlobalValue>(V)) return 0; + if (isa<Constant>(V)) return 0; std::map<Value*, unsigned>::const_iterator I = RankMap.find(V); if (I != RankMap.end()) return I->second; return 0; // Must be some other global thing @@ -476,7 +476,8 @@ bool CEE::ForwardCorrelatedEdgeDestination(TerminatorInst *TI, unsigned SuccNo, ValueInfo &PredicateVI = NewRI.getValueInfo(BI->getCondition()); if (PredicateVI.getReplacement() && - isa<Constant>(PredicateVI.getReplacement())) { + isa<Constant>(PredicateVI.getReplacement()) && + !isa<GlobalValue>(PredicateVI.getReplacement())) { ConstantBool *CB = cast<ConstantBool>(PredicateVI.getReplacement()); // Forward to the successor that corresponds to the branch we will take. |