mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Move the capture analysis from MemoryDependencyAnalysis to a more general place
so that it can be reused in MemCpyOptimizer. This analysis is needed to remove an unnecessary memcpy when returning a struct into a local variable. rdar://11341081 PR12686 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -662,7 +662,11 @@ bool MemCpyOpt::performCallSlotOptzn(Instruction *cpy,
|
||||
// the use analysis, we also need to know that it does not sneakily
|
||||
// access dest. We rely on AA to figure this out for us.
|
||||
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
|
||||
if (AA.getModRefInfo(C, cpyDest, srcSize) != AliasAnalysis::NoModRef)
|
||||
AliasAnalysis::ModRefResult MR = AA.getModRefInfo(C, cpyDest, srcSize);
|
||||
// If necessary, perform additional analysis.
|
||||
if (MR != AliasAnalysis::NoModRef)
|
||||
MR = AA.callCapturesBefore(C, cpyDest, srcSize, &DT);
|
||||
if (MR != AliasAnalysis::NoModRef)
|
||||
return false;
|
||||
|
||||
// All the checks have passed, so do the transformation.
|
||||
|
Reference in New Issue
Block a user