[llvm-commits] CVS: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Oct 23 13:50:01 PDT 2003
Changes in directory llvm/lib/Transforms/IPO:
IPConstantPropagation.cpp updated: 1.1 -> 1.2
---
Log message:
We might as well strip off any CPRs before propagation
---
Diffs of the changes: (+4 -1)
Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.1 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.2
--- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.1 Thu Oct 23 11:52:27 2003
+++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Oct 23 13:49:23 2003
@@ -103,7 +103,10 @@
// Do we have a constant argument!?
if (!ArgumentConstants[i].second) {
assert(ArgumentConstants[i].first && "Unknown constant value!");
- AI->replaceAllUsesWith(ArgumentConstants[i].first);
+ Value *V = ArgumentConstants[i].first;
+ if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
+ V = CPR->getValue();
+ AI->replaceAllUsesWith(V);
++NumArgumentsProped;
}
return true;
More information about the llvm-commits
mailing list