Index: lib/CodeGen/IfConversion.cpp =================================================================== --- lib/CodeGen/IfConversion.cpp +++ lib/CodeGen/IfConversion.cpp @@ -7,7 +7,8 @@ // //===----------------------------------------------------------------------===// // -// This file implements the machine instruction level if-conversion pass. +// This file implements the machine instruction level if-conversion pass, which +// tries to convert conditional branches into predicated instructions. // //===----------------------------------------------------------------------===// @@ -673,6 +674,12 @@ if (I->isDebugValue()) continue; + // We don't need to set CannotBeCopied to true if BBI contains a convergent + // op. CannotBeCopied prevents us from moving a BB into a predecessor and + // predicating it, if the BB that has more than one predecessor. But this + // transformation is safe on BBs that contain convergent ops, as we're + // moving the convergent op *up* the CFG, thus removing, rather than adding, + // control-flow dependencies. if (I->isNotDuplicable()) BBI.CannotBeCopied = true;