mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 07:17:36 +00:00
LoopIdiom: Fix a serious missed optimization: we only turned top-level loops into memmove.
Thanks to Preston Briggs for catching this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167045 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -555,10 +555,11 @@ processLoopStoreOfLoopLoad(StoreInst *SI, unsigned StoreSize,
|
||||
// can safely emit a memcpy.
|
||||
OwningPtr<Dependence> Dep(DA.depends(SI, LI, true));
|
||||
if (Dep) {
|
||||
// If there is a dependence but the direction is positive we can still
|
||||
// safely turn this into memmove.
|
||||
if (Dep->getLevels() != 1 ||
|
||||
Dep->getDirection(1) != Dependence::DVEntry::GT)
|
||||
// If there is a dependence but the direction is positive (or none) we can
|
||||
// still safely turn this into memmove.
|
||||
unsigned Direction = Dep->getDirection(Dep->getLevels());
|
||||
if (Direction != Dependence::DVEntry::NONE &&
|
||||
Direction != Dependence::DVEntry::GT)
|
||||
return false;
|
||||
isMemcpySafe = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user