diff options
Diffstat (limited to 'llvm/lib/CodeGen/IfConversion.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/IfConversion.cpp | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/IfConversion.cpp b/llvm/lib/CodeGen/IfConversion.cpp index 105ab908d3fa..936de316e575 100644 --- a/llvm/lib/CodeGen/IfConversion.cpp +++ b/llvm/lib/CodeGen/IfConversion.cpp @@ -2244,6 +2244,15 @@ void IfConverter::MergeBlocks(BBInfo &ToBBI, BBInfo &FromBBI, bool AddEdges) {    assert(!FromMBB.hasAddressTaken() &&           "Removing a BB whose address is taken!"); +  // If we're about to splice an INLINEASM_BR from FromBBI, we need to update +  // ToBBI's successor list accordingly. +  if (FromMBB.mayHaveInlineAsmBr()) +    for (MachineInstr &MI : FromMBB) +      if (MI.getOpcode() == TargetOpcode::INLINEASM_BR) +        for (MachineOperand &MO : MI.operands()) +          if (MO.isMBB() && !ToBBI.BB->isSuccessor(MO.getMBB())) +            ToBBI.BB->addSuccessor(MO.getMBB(), BranchProbability::getZero()); +    // In case FromMBB contains terminators (e.g. return instruction),    // first move the non-terminator instructions, then the terminators.    MachineBasicBlock::iterator FromTI = FromMBB.getFirstTerminator();  | 
