mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
third bug from PR6119: the xor dupe extension allows
for arbitrary terminators in predecessors, don't assume it is a conditional or uncond branch. The testcase shows an example where they can happen with switches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1424,9 +1424,9 @@ bool JumpThreading::DuplicateCondBranchOnPHIIntoPred(BasicBlock *BB,
|
||||
|
||||
// Unless PredBB ends with an unconditional branch, split the edge so that we
|
||||
// can just clone the bits from BB into the end of the new PredBB.
|
||||
BranchInst *OldPredBranch = cast<BranchInst>(PredBB->getTerminator());
|
||||
BranchInst *OldPredBranch = dyn_cast<BranchInst>(PredBB->getTerminator());
|
||||
|
||||
if (!OldPredBranch->isUnconditional()) {
|
||||
if (OldPredBranch == 0 || !OldPredBranch->isUnconditional()) {
|
||||
PredBB = SplitEdge(PredBB, BB, this);
|
||||
OldPredBranch = cast<BranchInst>(PredBB->getTerminator());
|
||||
}
|
||||
|
Reference in New Issue
Block a user