Files
clang-p2996/llvm/test/Transforms/SimplifyCFG/switch-simplify-crash2.ll
Muhammad Omair Javaid 431969ede1 Revert "[SimplifyCFG] Transform for redirecting phis between unmergeable BB and SuccBB (#67275)"
This reverts commit fc86d031fe.

This change breaks LLVM buildbot clang-aarch64-sve-vls-2stage
https://lab.llvm.org/buildbot/#/builders/176/builds/5474
I am going to revert this patch as the bot has been failing for more than a day without a fix.
2023-09-26 15:47:16 +05:00

28 lines
584 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes="simplifycfg<forward-switch-cond;no-keep-loops>" < %s | FileCheck %s
define i8 @test() {
; CHECK-LABEL: @test(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[LOOP2:%.*]]
; CHECK: loop2:
; CHECK-NEXT: br label [[LOOP2]]
;
entry:
br label %loop
loop:
%phi1 = phi i8 [ 0, %entry ], [ %phi2, %loop2 ]
br label %loop2
loop2:
%phi2 = phi i8 [ %phi1, %loop ], [ 0, %loop2 ]
switch i8 %phi2, label %loop [
i8 0, label %loop2
i8 1, label %exit
]
exit:
ret i8 0
}