mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200281 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user