diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-01-28 02:38:36 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-01-28 02:38:36 +0000 |
commit | 26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3 (patch) | |
tree | a65d86dd391f8685236fb16cf2046d4603833099 /llvm/lib/Transforms/Scalar | |
parent | 020acd88ecc4b99632b6af54e7e7f77ab70b4a30 (diff) | |
download | bcm5719-llvm-26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3.tar.gz bcm5719-llvm-26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3.zip |
Update optimization passes to handle inalloca arguments
Summary:
I searched Transforms/ and Analysis/ for 'ByVal' and updated those call
sites to check for inalloca if appropriate.
I added tests for any change that would allow an optimization to fire on
inalloca.
Reviewers: nlewycky
Differential Revision: http://llvm-reviews.chandlerc.com/D2449
llvm-svn: 200281
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 49f19bc60f2..453dca303d3 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -374,8 +374,8 @@ static OverwriteResult isOverwrite(const AliasAnalysis::Location &Later, return OverwriteUnknown; // Check to see if the later store is to the entire object (either a global, - // an alloca, or a byval argument). If so, then it clearly overwrites any - // other store to the same object. + // an alloca, or a byval/inalloca argument). If so, then it clearly + // overwrites any other store to the same object. const DataLayout *TD = AA.getDataLayout(); const Value *UO1 = GetUnderlyingObject(P1, TD), @@ -742,11 +742,11 @@ bool DSE::handleEndBlock(BasicBlock &BB) { DeadStackObjects.insert(I); } - // Treat byval arguments the same, stores to them are dead at the end of the - // function. + // Treat byval or inalloca arguments the same, stores to them are dead at the + // end of the function. for (Function::arg_iterator AI = BB.getParent()->arg_begin(), AE = BB.getParent()->arg_end(); AI != AE; ++AI) - if (AI->hasByValAttr()) + if (AI->hasByValOrInAllocaAttr()) DeadStackObjects.insert(AI); // Scan the basic block backwards |