mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
when folding duplicate conditions, delete the
now-probably-dead instruction tree feeding it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -450,9 +450,11 @@ bool JumpThreading::ProcessBranchOnDuplicateCond(BasicBlock *PredBB,
|
||||
<< "' folding condition to '" << BranchDir << "': "
|
||||
<< *BB->getTerminator() << '\n');
|
||||
++NumFolds;
|
||||
Value *OldCond = DestBI->getCondition();
|
||||
DestBI->setCondition(ConstantInt::get(Type::getInt1Ty(BB->getContext()),
|
||||
BranchDir));
|
||||
ConstantFoldTerminator(BB);
|
||||
RecursivelyDeleteTriviallyDeadInstructions(OldCond);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user