[llvm-commits] CVS: llvm/lib/Transforms/IPO/InlineSimple.cpp

LLVM llvm at cs.uiuc.edu
Sat Jul 17 17:27:16 PDT 2004



Changes in directory llvm/lib/Transforms/IPO:

InlineSimple.cpp updated: 1.62 -> 1.63

---
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/IPO/InlineSimple.cpp
diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.62 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.63
--- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.62	Thu Apr  8 01:34:31 2004
+++ llvm/lib/Transforms/IPO/InlineSimple.cpp	Sat Jul 17 19:27:06 2004
@@ -78,8 +78,7 @@
       Instruction &Inst = cast<Instruction>(**UI);
       bool AllOperandsConstant = true;
       for (unsigned i = 0, e = Inst.getNumOperands(); i != e; ++i)
-        if (!isa<Constant>(Inst.getOperand(i)) &&
-            !isa<GlobalValue>(Inst.getOperand(i)) && Inst.getOperand(i) != V) {
+        if (!isa<Constant>(Inst.getOperand(i)) && Inst.getOperand(i) != V) {
           AllOperandsConstant = false;
           break;
         }
@@ -205,7 +204,7 @@
     // If this is a constant being passed into the function, use the argument
     // weights calculated for the callee to determine how much will be folded
     // away with this information.
-    } else if (isa<Constant>(I) || isa<GlobalVariable>(I)) {
+    } else if (isa<Constant>(I)) {
       if (ArgNo < CalleeFI.ArgumentWeights.size())
         InlineCost -= CalleeFI.ArgumentWeights[ArgNo].ConstantWeight;
     }





More information about the llvm-commits mailing list