diff options
author | Torok Edwin <edwintorok@gmail.com> | 2009-09-24 18:33:42 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2009-09-24 18:33:42 +0000 |
commit | 21bd8c9fc5e3a17b0d593c5b6f9c66c353a2eed8 (patch) | |
tree | 7d1ef6b3121dad4e1bbc50df007e9e7c7348e1eb /llvm/lib/Transforms/IPO/IPConstantPropagation.cpp | |
parent | 46cd46731082e7ad6cd3901e2a13f68d7a774cab (diff) | |
download | llvm-21bd8c9fc5e3a17b0d593c5b6f9c66c353a2eed8.zip llvm-21bd8c9fc5e3a17b0d593c5b6f9c66c353a2eed8.tar.gz llvm-21bd8c9fc5e3a17b0d593c5b6f9c66c353a2eed8.tar.bz2 |
Constant propagating byval pointer is safe if function is readonly.
llvm-svn: 82700
Diffstat (limited to 'llvm/lib/Transforms/IPO/IPConstantPropagation.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/IPConstantPropagation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp index 95c3f4e..7b0e9c7 100644 --- a/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp +++ b/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp @@ -130,8 +130,8 @@ bool IPCP::PropagateConstantsIntoArguments(Function &F) { Function::arg_iterator AI = F.arg_begin(); for (unsigned i = 0, e = ArgumentConstants.size(); i != e; ++i, ++AI) { // Do we have a constant argument? - if (ArgumentConstants[i].second || AI->use_empty() || - (AI->hasByValAttr() && isa<PointerType>(AI->getType()))) + if (ArgumentConstants[i].second || AI->use_empty() || + (AI->hasByValAttr() && !F.onlyReadsMemory())) continue; Value *V = ArgumentConstants[i].first; |