mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Check alignment of loads when deciding whether it is safe to execute them
unconditionally. Besides checking the offset, also check that the underlying object is aligned as much as the load itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -211,7 +211,8 @@ bool TailCallElim::CanMoveAboveCall(Instruction *I, CallInst *CI) {
|
||||
// FIXME: Writes to memory only matter if they may alias the pointer
|
||||
// being loaded from.
|
||||
if (CI->mayWriteToMemory() ||
|
||||
!isSafeToLoadUnconditionally(L->getPointerOperand(), L))
|
||||
!isSafeToLoadUnconditionally(L->getPointerOperand(), L,
|
||||
L->getAlignment()))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user