@@ -499,4 +499,30 @@ define i1 @lshr_value(i32 %length.i, i32 %i, i32 %v) {
499
499
ret i1 %res
500
500
}
501
501
502
+ define i1 @same_ops_with_constant (i8 %x ) {
503
+ ; CHECK-LABEL: @same_ops_with_constant(
504
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X:%.*]], 5
505
+ ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[X]], 5
506
+ ; CHECK-NEXT: [[RES:%.*]] = icmp ule i1 [[CMP1]], [[CMP2]]
507
+ ; CHECK-NEXT: ret i1 [[RES]]
508
+ ;
509
+ %cmp1 = icmp sgt i8 %x , 5
510
+ %cmp2 = icmp ugt i8 %x , 5
511
+ %res = icmp ule i1 %cmp1 , %cmp2
512
+ ret i1 %res
513
+ }
514
+
515
+ define i1 @same_ops_with_constant_wrong_sign (i8 %x ) {
516
+ ; CHECK-LABEL: @same_ops_with_constant_wrong_sign(
517
+ ; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X:%.*]], -5
518
+ ; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i8 [[X]], -5
519
+ ; CHECK-NEXT: [[RES:%.*]] = icmp ule i1 [[CMP1]], [[CMP2]]
520
+ ; CHECK-NEXT: ret i1 [[RES]]
521
+ ;
522
+ %cmp1 = icmp sgt i8 %x , -5
523
+ %cmp2 = icmp ugt i8 %x , -5
524
+ %res = icmp ule i1 %cmp1 , %cmp2
525
+ ret i1 %res
526
+ }
527
+
502
528
declare void @llvm.assume (i1 )
0 commit comments