1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -constraint-elimination -S %s | FileCheck %s
4 ; Make sure constraints where all variable coefficients are 0 are handled
7 define i1 @test_1_always_false(i32 %A, i32 %B) {
8 ; CHECK-LABEL: @test_1_always_false(
9 ; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i32 [[A:%.*]], [[A]]
10 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_END_I16:%.*]], label [[IF_THEN_I10:%.*]]
12 ; CHECK-NEXT: ret i1 false
14 ; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i32 [[A]], [[A]]
15 ; CHECK-NEXT: ret i1 false
17 %c.1 = icmp ugt i32 %A, %A
18 br i1 %c.1, label %if.end.i16, label %if.then.i10
24 %c.2 = icmp ugt i32 %A, %A
28 define i1 @test_2_always_true(i32 %A, i32 %B) {
29 ; CHECK-LABEL: @test_2_always_true(
30 ; CHECK-NEXT: [[C_1:%.*]] = icmp uge i32 [[A:%.*]], [[B:%.*]]
31 ; CHECK-NEXT: br i1 [[C_1]], label [[IF_END_I16:%.*]], label [[IF_THEN_I10:%.*]]
33 ; CHECK-NEXT: ret i1 false
35 ; CHECK-NEXT: [[C_2:%.*]] = icmp uge i32 [[A]], [[A]]
36 ; CHECK-NEXT: ret i1 true
38 %c.1 = icmp uge i32 %A, %B
39 br i1 %c.1, label %if.end.i16, label %if.then.i10
45 %c.2 = icmp uge i32 %A, %A