brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 649beb3 Raw
93 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=callsite-splitting,simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s3 4define i16 @test1() {5; CHECK-LABEL: @test1(6; CHECK-NEXT:  entry:7; CHECK-NEXT:    [[SPEC_SELECT:%.*]] = select i1 undef, i16 1, i16 08; CHECK-NEXT:    [[TOBOOL18:%.*]] = icmp ne i16 [[SPEC_SELECT]], 09; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL18]], true10; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])11; CHECK-NEXT:    br label [[FOR_COND12:%.*]]12; CHECK:       for.cond12:13; CHECK-NEXT:    call void @callee(i16 [[SPEC_SELECT]])14; CHECK-NEXT:    br label [[FOR_COND12]]15;16entry:17  %spec.select = select i1 undef, i16 1, i16 018  %tobool18 = icmp ne i16 %spec.select, 019  br i1 %tobool18, label %for.cond12.us, label %for.cond1220 21for.cond12.us:22  unreachable23 24for.cond12:25  call void @callee(i16 %spec.select)26  br label %for.cond1227}28 29define i16 @test2() {30; CHECK-LABEL: @test2(31; CHECK-NEXT:  entry:32; CHECK-NEXT:    [[S:%.*]] = select i1 undef, i16 1, i16 033; CHECK-NEXT:    [[TOBOOL18:%.*]] = icmp ne i16 [[S]], 034; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL18]], true35; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])36; CHECK-NEXT:    br label [[FOR_COND12:%.*]]37; CHECK:       for.cond12:38; CHECK-NEXT:    call void @callee(i16 [[S]])39; CHECK-NEXT:    [[ADD:%.*]] = add i16 [[S]], 1040; CHECK-NEXT:    [[ADD2:%.*]] = add i16 [[S]], 1041; CHECK-NEXT:    br label [[FOR_COND12]]42;43entry:44  %s= select i1 undef, i16 1, i16 045  %tobool18 = icmp ne i16 %s, 046  br i1 %tobool18, label %for.cond12.us, label %for.cond1247 48for.cond12.us:49  unreachable50 51for.cond12:52  call void @callee(i16 %s)53  %add = add i16 %s, 1054  %add2 = add i16 %s, 1055  br label %for.cond1256}57 58define i16 @test3(i1 %c) {59; CHECK-LABEL: @test3(60; CHECK-NEXT:  entry:61; CHECK-NEXT:    [[S:%.*]] = select i1 undef, i16 1, i16 062; CHECK-NEXT:    [[TOBOOL18:%.*]] = icmp ne i16 [[S]], 063; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL18]], true64; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])65; CHECK-NEXT:    br label [[FOR_COND12:%.*]]66; CHECK:       for.cond12:67; CHECK-NEXT:    call void @callee(i16 [[S]])68; CHECK-NEXT:    [[ADD:%.*]] = add i16 [[S]], 1069; CHECK-NEXT:    [[ADD2:%.*]] = add i16 [[ADD]], 1070; CHECK-NEXT:    br i1 [[C:%.*]], label [[FOR_COND12]], label [[EXIT:%.*]]71; CHECK:       exit:72; CHECK-NEXT:    ret i16 [[ADD2]]73;74entry:75  %s= select i1 undef, i16 1, i16 076  %tobool18 = icmp ne i16 %s, 077  br i1 %tobool18, label %for.cond12.us, label %for.cond1278 79for.cond12.us:80  unreachable81 82for.cond12:83  call void @callee(i16 %s)84  %add = add i16 %s, 1085  %add2 = add i16 %add, 1086  br i1 %c, label %for.cond12, label %exit87 88exit:89  ret i16 %add290}91 92declare void @callee(i16 %flag)93