xref: /llvm-project/llvm/test/Transforms/SimpleLoopUnswitch/options.ll (revision 2f79f5438cd6f4fa0fdc32458911c2d163f917c0)
10024ec59SArthur Eubanks; RUN: opt -passes='simple-loop-unswitch<no-trivial>' -S < %s | FileCheck %s --check-prefix=NOTRIVIAL
20024ec59SArthur Eubanks; RUN: opt -passes='simple-loop-unswitch' -S < %s | FileCheck %s --check-prefix=TRIVIAL
30024ec59SArthur Eubanks; RUN: opt -passes='simple-loop-unswitch<trivial>' -S < %s | FileCheck %s --check-prefix=TRIVIAL
40024ec59SArthur Eubanks
50024ec59SArthur Eubanksdeclare void @some_func() noreturn
60024ec59SArthur Eubanks
70024ec59SArthur Eubanks; NOTRIVIAL-NOT: split
80024ec59SArthur Eubanks; TRIVIAL: split
9*2f79f543SNikita Popovdefine i32 @test1(ptr %var, i1 %cond1, i1 %cond2) {
100024ec59SArthur Eubanksentry:
110024ec59SArthur Eubanks  br label %loop_begin
120024ec59SArthur Eubanks
130024ec59SArthur Eubanksloop_begin:
140024ec59SArthur Eubanks  br i1 %cond1, label %continue, label %loop_exit	; first trivial condition
150024ec59SArthur Eubanks
160024ec59SArthur Eubankscontinue:
17*2f79f543SNikita Popov  %var_val = load i32, ptr %var
180024ec59SArthur Eubanks  br i1 %cond2, label %do_something, label %loop_exit	; second trivial condition
190024ec59SArthur Eubanks
200024ec59SArthur Eubanksdo_something:
210024ec59SArthur Eubanks  call void @some_func() noreturn nounwind
220024ec59SArthur Eubanks  br label %loop_begin
230024ec59SArthur Eubanks
240024ec59SArthur Eubanksloop_exit:
250024ec59SArthur Eubanks  ret i32 0
260024ec59SArthur Eubanks}