mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the underlying object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1650,7 +1650,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
|
||||
// put anywhere; this can be improved, but should be conservatively safe.
|
||||
if (!allSingleSucc &&
|
||||
// FIXME: REEVALUTE THIS.
|
||||
!isSafeToLoadUnconditionally(LoadPtr, UnavailablePred->getTerminator())) {
|
||||
!isSafeToLoadUnconditionally(LoadPtr,
|
||||
UnavailablePred->getTerminator(), TD)) {
|
||||
assert(NewInsts.empty() && "Should not have inserted instructions");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user