xref: /llvm-project/llvm/test/Transforms/SimpleLoopUnswitch/options.ll (revision 2f79f5438cd6f4fa0fdc32458911c2d163f917c0)
1; RUN: opt -passes='simple-loop-unswitch<no-trivial>' -S < %s | FileCheck %s --check-prefix=NOTRIVIAL
2; RUN: opt -passes='simple-loop-unswitch' -S < %s | FileCheck %s --check-prefix=TRIVIAL
3; RUN: opt -passes='simple-loop-unswitch<trivial>' -S < %s | FileCheck %s --check-prefix=TRIVIAL
4
5declare void @some_func() noreturn
6
7; NOTRIVIAL-NOT: split
8; TRIVIAL: split
9define i32 @test1(ptr %var, i1 %cond1, i1 %cond2) {
10entry:
11  br label %loop_begin
12
13loop_begin:
14  br i1 %cond1, label %continue, label %loop_exit	; first trivial condition
15
16continue:
17  %var_val = load i32, ptr %var
18  br i1 %cond2, label %do_something, label %loop_exit	; second trivial condition
19
20do_something:
21  call void @some_func() noreturn nounwind
22  br label %loop_begin
23
24loop_exit:
25  ret i32 0
26}