mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Fix PR3298, a crash in Jump Threading. Apparently even
jump threading can have bugs, who knew? ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -504,6 +504,10 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
|
||||
// If the value if the load is locally available within the block, just use
|
||||
// it. This frequently occurs for reg2mem'd allocas.
|
||||
//cerr << "LOAD ELIMINATED:\n" << *BBIt << *LI << "\n";
|
||||
|
||||
// If the returned value is the load itself, replace with an undef. This can
|
||||
// only happen in dead loops.
|
||||
if (AvailableVal == LI) AvailableVal = UndefValue::get(LI->getType());
|
||||
LI->replaceAllUsesWith(AvailableVal);
|
||||
LI->eraseFromParent();
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user