This reverts commit 1fc425380e9860a6beb53fa68d02e7fb14969963.
This is causing some test failures in cases like
for (;;) { callIntrinsicStore... switch (undef) { case 0: break; } }
where LLVM is completely optimizing away the loop. The IR in mind is
something like the following.
So, independent of which jump target we take in 10, we will still be
able to reach the final merge block. With the optimization, the loop
body (add) wil be optimized away and we will never reach the merge
block.
entry: br label %0 0: br label %1, !llvm.loop 1: br label %2 2: %3 = phi i32 [ 0, %1 ], [ %14, %13 ] br label %4, !llvm.loop !3 4: ; preds = %2 %5 = icmp slt i32 %3, 1 br i1 %5, label %6, label %15 6: ; preds = %4 br label %7 7: ; preds = %6 br label %8, !llvm.loop !4 8: ; preds = %7 br label %9 9: ; preds = %8 br label %10 10: ; preds = %9 br i1 undef, label %11, label %12 11: ; preds = %10 br label %15 12: ; preds = %10 br label %13 13: ; preds = %12 %14 = add i32 %3, 1 br label %2, !llvm.loop !5 15: ; preds = %11, %4 br label %17 16: ; No predecessors! br label %17 17: ; preds = %15, %16 call void (...) @write(...) ret void