summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.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/Scalar/SCCP.cpp
parent48f7ce88a6040c12d4c7d0a5bd208cf1e0bda9d1 (diff)
downloadllvm-30a94e3b4203cee64db0edd997780bbe4ad0acdc.tar.gz
llvm-30a94e3b4203cee64db0edd997780bbe4ad0acdc.tar.bz2
llvm-30a94e3b4203cee64db0edd997780bbe4ad0acdc.tar.xz
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/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index f0b5d7702e..bf9ec0e4ad 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1267,6 +1267,10 @@ CallOverdefined:
for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
AI != E; ++AI, ++CAI) {
LatticeVal &IV = ValueState[AI];
+ if (AI->hasByValAttr() && isa<PointerType>(AI->getType())) {
+ IV.markOverdefined();
+ continue;
+ }
if (!IV.isOverdefined())
mergeInValue(IV, AI, getValueState(*CAI));
}