diff --git a/llvm/lib/CodeGen/EarlyIfConversion.cpp b/llvm/lib/CodeGen/EarlyIfConversion.cpp --- a/llvm/lib/CodeGen/EarlyIfConversion.cpp +++ b/llvm/lib/CodeGen/EarlyIfConversion.cpp @@ -343,8 +343,11 @@ // Apply predicate to all instructions in the machine block. void SSAIfConv::PredicateBlock(MachineBasicBlock *MBB, bool ReversePredicate) { auto Condition = Cond; - if (ReversePredicate) - TII->reverseBranchCondition(Condition); + if (ReversePredicate) { + bool CanRevCond = !TII->reverseBranchCondition(Condition); + assert(CanRevCond && "Reversed predicate is not supported"); + (void)CanRevCond; + } // Terminators don't need to be predicated as they will be removed. for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->getFirstTerminator();