1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes='function(dse),cgscc(inline),function(sroa,gvn,sccp)' -S %s | FileCheck %s
4 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
6 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
8 declare void @llvm.assume(i1 noundef)
12 define internal i1 @check_cond(ptr %a) #0 {
14 %c = icmp eq i32 %l, 1
15 br i1 %c, label %then, label %else
18 %res = call i1 @cond()
26 ; CHECK-LABEL: define i32 @test() {
28 ; CHECK-NEXT: br label [[THEN_I:%.*]]
30 ; CHECK-NEXT: [[RES_I:%.*]] = call i1 @cond()
31 ; CHECK-NEXT: br label [[CHECK_COND_EXIT:%.*]]
32 ; CHECK: check_cond.exit:
33 ; CHECK-NEXT: call void @llvm.assume(i1 [[RES_I]])
34 ; CHECK-NEXT: ret i32 0
37 %a = alloca i32, align 4
38 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a)
39 store i32 1, ptr %a, align 4
40 %res = call i1 @check_cond(ptr %a)
41 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a)
42 call void @llvm.assume(i1 %res)
46 attributes #0 = { nounwind readonly willreturn }