mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
fix PR9017, a bug where we'd assert when promoting in unreachable
code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124100 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -469,6 +469,9 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
|
||||
LoadInst *ALoad = LiveInLoads[i];
|
||||
Value *NewVal = SSA.GetValueInMiddleOfBlock(ALoad->getParent());
|
||||
replaceLoadWithValue(ALoad, NewVal);
|
||||
|
||||
// Avoid assertions in unreachable code.
|
||||
if (NewVal == ALoad) NewVal = UndefValue::get(NewVal->getType());
|
||||
ALoad->replaceAllUsesWith(NewVal);
|
||||
ReplacedLoads[ALoad] = NewVal;
|
||||
}
|
||||
|
Reference in New Issue
Block a user