1 ; RUN: opt -passes='loop(loop-instsimplify,simplify-cfg,unswitch),verify<loops>' -S < %s | FileCheck %s
2 ; RUN: opt -enable-mssa-loop-dependency=true -verify-memoryssa -passes='loop(loop-instsimplify,simplify-cfg,unswitch),verify<loops>' -S < %s | FileCheck %s
4 declare void @some_func() noreturn
6 define i32 @test1(i32* %var, i1 %cond1, i1 %cond2) {
11 ; CHECK-NEXT: br i1 %{{.*}}, label %entry.split, label %loop_exit.split
14 ; CHECK-NEXT: br i1 %{{.*}}, label %entry.split.split, label %loop_exit
16 ; CHECK: entry.split.split:
17 ; CHECK-NEXT: br label %loop_begin
20 br i1 %cond1, label %continue, label %loop_exit ; first trivial condition
23 %var_val = load i32, i32* %var
24 %var_cond = trunc i32 %var_val to i1
25 %maybe_cond = select i1 %cond1, i1 %cond2, i1 %var_cond
26 br i1 %maybe_cond, label %do_something, label %loop_exit ; second trivial condition
29 call void @some_func() noreturn nounwind
33 ; CHECK-NEXT: br label %loop_begin
38 ; CHECK-NEXT: br label %loop_exit.split
40 ; CHECK: loop_exit.split: