Index: lib/Transforms/Scalar/LoopUnswitch.cpp =================================================================== --- lib/Transforms/Scalar/LoopUnswitch.cpp +++ lib/Transforms/Scalar/LoopUnswitch.cpp @@ -641,7 +641,8 @@ break; } } - } + } else + return false; // If we didn't find a single unique LoopExit block, or if the loop exit block // contains phi nodes, this isn't trivial.