diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-23 18:49:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-23 18:49:23 +0000 |
commit | 12b78db6855cfe9a338d5b6e762d1e10cadb6967 (patch) | |
tree | afad54939e06d2b076b508616194fd4b0625c0c8 | |
parent | bf9584b041891d0f079f7cd2ae44d9c1defe1e4d (diff) | |
download | llvm-12b78db6855cfe9a338d5b6e762d1e10cadb6967.zip llvm-12b78db6855cfe9a338d5b6e762d1e10cadb6967.tar.gz llvm-12b78db6855cfe9a338d5b6e762d1e10cadb6967.tar.bz2 |
We might as well strip off any CPRs before propagation
llvm-svn: 9437
-rw-r--r-- | llvm/lib/Transforms/IPO/IPConstantPropagation.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp index dc8698e..bb21f11 100644 --- a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -103,7 +103,10 @@ bool IPCP::processFunction(Function &F) { // 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; |