aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/IPConstantPropagation.cpp
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-09-24 09:47:18 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-09-24 09:47:18 +0000
commit30a94e3b4203cee64db0edd997780bbe4ad0acdc (patch)
tree933afcf9967cb4b73c1c5fb731b12a6dfe16c0fd /lib/Transforms/IPO/IPConstantPropagation.cpp
parent48f7ce88a6040c12d4c7d0a5bd208cf1e0bda9d1 (diff)
Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value. This fixes PR5038. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82689 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/IPConstantPropagation.cpp')
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/IPConstantPropagation.cpp b/lib/Transforms/IPO/IPConstantPropagation.cpp
index bb2448610f..95c3f4e354 100644
--- a/lib/Transforms/IPO/IPConstantPropagation.cpp
+++ b/lib/Transforms/IPO/IPConstantPropagation.cpp
@@ -130,7 +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())
+ if (ArgumentConstants[i].second || AI->use_empty() ||
+ (AI->hasByValAttr() && isa<PointerType>(AI->getType())))
continue;
Value *V = ArgumentConstants[i].first;