14ceecc82SFlorian Hahn; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 28ebb3eacSBjorn Pettersson; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s 34ceecc82SFlorian Hahn 44ceecc82SFlorian Hahn; Make sure constraints where all variable coefficients are 0 are handled 54ceecc82SFlorian Hahn; properly. 64ceecc82SFlorian Hahn 74ceecc82SFlorian Hahndefine i1 @test_1_always_false(i32 %A, i32 %B) { 84ceecc82SFlorian Hahn; CHECK-LABEL: @test_1_always_false( 9*9fd7a2e3SFlorian Hahn; CHECK-NEXT: br i1 false, label [[IF_END_I16:%.*]], label [[IF_THEN_I10:%.*]] 104ceecc82SFlorian Hahn; CHECK: if.then.i10: 114ceecc82SFlorian Hahn; CHECK-NEXT: ret i1 false 124ceecc82SFlorian Hahn; CHECK: if.end.i16: 134ceecc82SFlorian Hahn; CHECK-NEXT: ret i1 false 144ceecc82SFlorian Hahn; 154ceecc82SFlorian Hahn %c.1 = icmp ugt i32 %A, %A 164ceecc82SFlorian Hahn br i1 %c.1, label %if.end.i16, label %if.then.i10 174ceecc82SFlorian Hahn 184ceecc82SFlorian Hahnif.then.i10: 194ceecc82SFlorian Hahn ret i1 false 204ceecc82SFlorian Hahn 214ceecc82SFlorian Hahnif.end.i16: 224ceecc82SFlorian Hahn %c.2 = icmp ugt i32 %A, %A 234ceecc82SFlorian Hahn ret i1 %c.2 244ceecc82SFlorian Hahn} 254ceecc82SFlorian Hahn 264ceecc82SFlorian Hahndefine i1 @test_2_always_true(i32 %A, i32 %B) { 274ceecc82SFlorian Hahn; CHECK-LABEL: @test_2_always_true( 284ceecc82SFlorian Hahn; CHECK-NEXT: [[C_1:%.*]] = icmp uge i32 [[A:%.*]], [[B:%.*]] 294ceecc82SFlorian Hahn; CHECK-NEXT: br i1 [[C_1]], label [[IF_END_I16:%.*]], label [[IF_THEN_I10:%.*]] 304ceecc82SFlorian Hahn; CHECK: if.then.i10: 314ceecc82SFlorian Hahn; CHECK-NEXT: ret i1 false 324ceecc82SFlorian Hahn; CHECK: if.end.i16: 334ceecc82SFlorian Hahn; CHECK-NEXT: ret i1 true 344ceecc82SFlorian Hahn; 354ceecc82SFlorian Hahn %c.1 = icmp uge i32 %A, %B 364ceecc82SFlorian Hahn br i1 %c.1, label %if.end.i16, label %if.then.i10 374ceecc82SFlorian Hahn 384ceecc82SFlorian Hahnif.then.i10: 394ceecc82SFlorian Hahn ret i1 false 404ceecc82SFlorian Hahn 414ceecc82SFlorian Hahnif.end.i16: 424ceecc82SFlorian Hahn %c.2 = icmp uge i32 %A, %A 434ceecc82SFlorian Hahn ret i1 %c.2 444ceecc82SFlorian Hahn} 45