1 ; RUN: opt -licm -basicaa < %s -S | FileCheck %s 2 ; RUN: opt -aa-pipeline=basic-aa -passes='require<aa>,require<targetir>,require<scalar-evolution>,loop(licm)' < %s -S | FileCheck %s 3 4 define void @f_0(i1 %p) nounwind ssp { 5 ; CHECK-LABEL: @f_0( 6 entry: 7 br label %for.body 8 9 for.body: 10 br i1 undef, label %if.then, label %for.cond.backedge 11 12 for.cond.backedge: 13 br i1 undef, label %for.end104, label %for.body 14 15 if.then: 16 br i1 undef, label %if.then27, label %if.end.if.end.split_crit_edge.critedge 17 18 if.then27: 19 ; CHECK: tail call void @llvm.assume 20 tail call void @llvm.assume(i1 %p) 21 br label %for.body61.us 22 23 if.end.if.end.split_crit_edge.critedge: 24 br label %for.body61 25 26 for.body61.us: 27 br i1 undef, label %for.cond.backedge, label %for.body61.us 28 29 for.body61: 30 br i1 undef, label %for.cond.backedge, label %for.body61 31 32 for.end104: 33 ret void 34 } 35 36 define void @f_1(i1 %cond, i32* %ptr) { 37 ; CHECK-LABEL: @f_1( 38 ; CHECK: %val = load i32, i32* %ptr 39 ; CHECK-NEXT: br label %loop 40 41 entry: 42 br label %loop 43 44 loop: 45 %x = phi i32 [ 0, %entry ], [ %x.inc, %loop ] 46 call void @llvm.assume(i1 %cond) 47 %val = load i32, i32* %ptr 48 %x.inc = add i32 %x, %val 49 br label %loop 50 } 51 52 declare void @llvm.assume(i1) 53