36 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s3 4define i1 @test_overflow_sub_coefficients(i8 %x, i64 %y) {5; CHECK-LABEL: define i1 @test_overflow_sub_coefficients6; CHECK-SAME: (i8 [[X:%.*]], i64 [[Y:%.*]]) {7; CHECK-NEXT: bb:8; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[X]] to i649; CHECK-NEXT: [[SHL:%.*]] = shl nuw nsw i64 [[ZEXT]], 6310; CHECK-NEXT: [[ICMP:%.*]] = icmp uge i64 [[SHL]], [[Y]]11; CHECK-NEXT: ret i1 [[ICMP]]12;13bb:14 %zext = zext i8 %x to i6415 %shl = shl nuw nsw i64 %zext, 6316 %icmp = icmp uge i64 %shl, %y17 ret i1 %icmp18}19 20define i1 @test_overflow_in_negate_constraint(i8 %x, i64 %y) {21; CHECK-LABEL: define i1 @test_overflow_in_negate_constraint22; CHECK-SAME: (i8 [[X:%.*]], i64 [[Y:%.*]]) {23; CHECK-NEXT: bb:24; CHECK-NEXT: [[ZEXT:%.*]] = zext i8 [[X]] to i6425; CHECK-NEXT: [[SHL:%.*]] = shl nuw nsw i64 [[ZEXT]], 6326; CHECK-NEXT: [[ICMP:%.*]] = icmp uge i64 [[Y]], [[SHL]]27; CHECK-NEXT: ret i1 [[ICMP]]28;29bb:30 %zext = zext i8 %x to i6431 %shl = shl nuw nsw i64 %zext, 6332 %icmp = icmp uge i64 %y, %shl33 ret i1 %icmp34}35 36