brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 9a6cad4 Raw
47 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -passes='function(dse),cgscc(inline),function(sroa,gvn,sccp)' -S %s | FileCheck %s3 4declare void @llvm.lifetime.start.p0(ptr nocapture)5 6declare void @llvm.lifetime.end.p0(ptr nocapture)7 8declare void @llvm.assume(i1 noundef)9 10declare i1 @cond() #011 12define internal i1 @check_cond(ptr %a) #0 {13  %l = load i32, ptr %a14  %c = icmp eq i32 %l, 115  br i1 %c, label %then, label %else16 17then:18  %res = call i1 @cond()19  ret i1 %res20 21else:22  ret i1 023}24 25define i32 @test() {26; CHECK-LABEL: define i32 @test() {27; CHECK-NEXT:  entry:28; CHECK-NEXT:    br label [[THEN_I:%.*]]29; CHECK:       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 035;36entry:37  %a = alloca i32, align 438  call void @llvm.lifetime.start.p0(ptr nonnull %a)39  store i32 1, ptr %a, align 440  %res = call i1 @check_cond(ptr %a)41  call void @llvm.lifetime.end.p0(ptr nonnull %a)42  call void @llvm.assume(i1 %res)43  ret i32 044}45 46attributes #0 = { nounwind readonly willreturn }47