47 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt -S -passes=ipsccp %s | FileCheck %s3 4; Make sure IPSCCP does not assume %r < 256 for @f1. Undef is passed at a call5; site, which won't be eliminated.6 7define i1 @constant_and_undef(i64 %a) {8; CHECK-LABEL: define i1 @constant_and_undef(9; CHECK-SAME: i64 [[A:%.*]]) {10; CHECK-NEXT: [[C_1:%.*]] = call i1 @f1(i64 undef)11; CHECK-NEXT: br label %[[BB1:.*]]12; CHECK: [[BB1]]:13; CHECK-NEXT: [[C_2:%.*]] = call i1 @f1(i64 10)14; CHECK-NEXT: br label %[[BB2:.*]]15; CHECK: [[BB2]]:16; CHECK-NEXT: [[RANGE:%.*]] = and i64 [[A]], 25517; CHECK-NEXT: [[C_3:%.*]] = call i1 @f1(i64 [[RANGE]])18; CHECK-NEXT: ret i1 true19;20 %c.1 = call i1 @f1(i64 undef)21 br label %bb122 23bb1:24 %c.2 = call i1 @f1(i64 10)25 br label %bb226 27bb2:28 %range = and i64 %a, 25529 %c.3 = call i1 @f1(i64 %range)30 %r.1 = and i1 %c.1, %c.231 %r.2 = and i1 %r.1, %c.332 ret i1 %r.233}34 35declare void @sideeffect(i1, i64 %a)36 37define internal i1 @f1(i64 %r) {38; CHECK-LABEL: define internal i1 @f1(39; CHECK-SAME: i64 [[R:%.*]]) {40; CHECK-NEXT: call void @sideeffect(i1 true, i64 [[R]])41; CHECK-NEXT: ret i1 poison42;43 %c = icmp ult i64 %r, 25644 call void @sideeffect(i1 %c, i64 %r)45 ret i1 %c46}47