mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
Use AA in LoadCombine
LoadCombine can be smarter about aborting when a writing instruction is encountered, instead of aborting upon encountering any writing instruction, use an AliasSetTracker, and only abort when encountering some write that might alias with the loads that could potentially be combined. This was originally motivated by comments made (and a test case provided) by David Majnemer in response to PR21448. It turned out that LoadCombine was not responsible for that PR, but LoadCombine should also be improved so that unrelated stores (and @llvm.assume) don't interrupt load combining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -242,7 +242,12 @@ bool AliasSetTracker::containsPointer(Value *Ptr, uint64_t Size,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool AliasSetTracker::containsUnknown(Instruction *Inst) const {
|
||||
for (const_iterator I = begin(), E = end(); I != E; ++I)
|
||||
if (!I->Forward && I->aliasesUnknownInst(Inst, AA))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
AliasSet *AliasSetTracker::findAliasSetForUnknownInst(Instruction *Inst) {
|
||||
AliasSet *FoundSet = nullptr;
|
||||
|
Reference in New Issue
Block a user