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

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



Changes in directory llvm/lib/Transforms/Scalar:

GCSE.cpp updated: 1.40 -> 1.41

---
Log message:

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


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

Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.40 llvm/lib/Transforms/Scalar/GCSE.cpp:1.41
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.40	Sun May 23 16:19:55 2004
+++ llvm/lib/Transforms/Scalar/GCSE.cpp	Sat Jul 17 19:28:47 2004
@@ -78,8 +78,7 @@
       VN.getEqualNumberNodes(AI, EqualValues);
       if (!EqualValues.empty()) {
         for (unsigned i = 0, e = EqualValues.size(); i != e; ++i)
-          if (isa<Constant>(EqualValues[i]) ||
-              isa<GlobalValue>(EqualValues[i])) {
+          if (isa<Constant>(EqualValues[i])) {
             AI->replaceAllUsesWith(EqualValues[i]);
             ++NumArgsRepl;
             Changed = true;
@@ -186,7 +185,7 @@
 
   // If we are not replacing the instruction with a constant, we cannot do
   // anything special.
-  if (!isa<Constant>(V)) {
+  if (!isa<Constant>(V) || isa<GlobalValue>(V)) {
     I->replaceAllUsesWith(V);
 
     if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {





More information about the llvm-commits mailing list