[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp

LLVM llvm at cs.uiuc.edu
Sat Jul 17 17:28:29 PDT 2004



Changes in directory llvm/lib/Transforms/Scalar:

CorrelatedExprs.cpp updated: 1.22 -> 1.23

---
Log message:

bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Minimize redundant isa<GlobalValue> usage
- Correct isa<Constant> for GlobalValue subclass


---
Diffs of the changes:  (+3 -2)

Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.22 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.23
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.22	Wed Jul 14 20:50:47 2004
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp	Sat Jul 17 19:28:19 2004
@@ -243,7 +243,7 @@
 
     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 @@
 
   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.





More information about the llvm-commits mailing list