50 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s3 4declare void @may_unwind()5 6declare i32 @__gxx_personality_v0(...)7 8define i1 @test_invoke_in_block_with_assume(i32 %x) personality ptr @__gxx_personality_v0 {9; CHECK-LABEL: @test_invoke_in_block_with_assume(10; CHECK-NEXT: entry:11; CHECK-NEXT: call void @may_unwind()12; CHECK-NEXT: [[C_1:%.*]] = icmp ult i32 [[X:%.*]], 1013; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])14; CHECK-NEXT: invoke void @may_unwind()15; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[LPAD:%.*]]16; CHECK: cont:17; CHECK-NEXT: [[C_2:%.*]] = icmp ult i32 [[X]], 918; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_2]]19; CHECK-NEXT: ret i1 [[RES_1]]20; CHECK: lpad:21; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }22; CHECK-NEXT: filter [0 x ptr] zeroinitializer23; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[X]], 924; CHECK-NEXT: [[RES_2:%.*]] = xor i1 true, [[C_3]]25; CHECK-NEXT: ret i1 [[RES_2]]26;27entry:28 call void @may_unwind()29 %c.1 = icmp ult i32 %x, 1030 call void @llvm.assume(i1 %c.1)31 invoke void @may_unwind()32 to label %cont unwind label %lpad33 34cont:35 %t.1 = icmp ult i32 %x, 1036 %c.2 = icmp ult i32 %x, 937 %res.1 = xor i1 %t.1, %c.238 ret i1 %res.139 40lpad:41 %lp = landingpad { ptr, i32 }42 filter [0 x ptr] zeroinitializer43 %t.2 = icmp ult i32 %x, 1044 %c.3 = icmp ult i32 %x, 945 %res.2 = xor i1 %t.2, %c.346 ret i1 %res.247}48 49declare void @llvm.assume(i1)50