[llvm-branch-commits] [llvm-branch] r83200 - in /llvm/branches/release_26: lib/Transforms/IPO/IPConstantPropagation.cpp lib/Transforms/Scalar/SCCP.cpp test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll
Tanya Lattner
tonic at nondot.org
Thu Oct 1 08:12:42 PDT 2009
Author: tbrethou
Date: Thu Oct 1 10:12:41 2009
New Revision: 83200
URL: http://llvm.org/viewvc/llvm-project?rev=83200&view=rev
Log:
Merge from mainline (reg).
Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.
Added:
llvm/branches/release_26/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll
- copied unchanged from r82689, llvm/trunk/test/Transforms/IPConstantProp/2009-09-24-byval-ptr.ll
Modified:
llvm/branches/release_26/lib/Transforms/IPO/IPConstantPropagation.cpp
llvm/branches/release_26/lib/Transforms/Scalar/SCCP.cpp
Modified: llvm/branches/release_26/lib/Transforms/IPO/IPConstantPropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Transforms/IPO/IPConstantPropagation.cpp?rev=83200&r1=83199&r2=83200&view=diff
==============================================================================
--- llvm/branches/release_26/lib/Transforms/IPO/IPConstantPropagation.cpp (original)
+++ llvm/branches/release_26/lib/Transforms/IPO/IPConstantPropagation.cpp Thu Oct 1 10:12:41 2009
@@ -130,7 +130,8 @@
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;
Modified: llvm/branches/release_26/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_26/lib/Transforms/Scalar/SCCP.cpp?rev=83200&r1=83199&r2=83200&view=diff
==============================================================================
--- llvm/branches/release_26/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/branches/release_26/lib/Transforms/Scalar/SCCP.cpp Thu Oct 1 10:12:41 2009
@@ -1263,6 +1263,10 @@
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));
}
More information about the llvm-branch-commits
mailing list