[llvm-commits] CVS: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
LLVM
llvm at cs.uiuc.edu
Sat Jul 17 17:26:47 PDT 2004
Changes in directory llvm/lib/Transforms/IPO:
IPConstantPropagation.cpp updated: 1.5 -> 1.6
---
Log message:
bug 122: http://llvm.cs.uiuc.edu/PR122 :
- Minimize redundant isa<GlobalValue> usage
---
Diffs of the changes: (+1 -5)
Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.5 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.6
--- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.5 Fri Nov 21 15:54:22 2003
+++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Sat Jul 17 19:26:34 2004
@@ -82,9 +82,8 @@
if (*AI == &F) return false; // Passes the function into itself
if (!ArgumentConstants[i].second) {
- if (isa<Constant>(*AI) || isa<GlobalValue>(*AI)) {
+ if (isa<Constant>(*AI)) {
Constant *C = dyn_cast<Constant>(*AI);
- if (!C) C = ConstantPointerRef::get(cast<GlobalValue>(*AI));
if (!ArgumentConstants[i].first)
ArgumentConstants[i].first = C;
@@ -114,9 +113,6 @@
if (!ArgumentConstants[i].second && !AI->use_empty()) {
assert(ArgumentConstants[i].first && "Unknown constant value!");
Value *V = ArgumentConstants[i].first;
- if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
- V = CPR->getValue();
-
AI->replaceAllUsesWith(V);
++NumArgumentsProped;
MadeChange = true;
More information about the llvm-commits
mailing list