File tree 1 file changed +13
-0
lines changed
llvm/test/Transforms/InstCombine
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,19 @@ define i8 @scmp_from_select_eq_and_gt(i32 %x, i32 %y) {
358
358
ret i8 %r
359
359
}
360
360
361
+ define i8 @scmp_from_select_eq_and_gt_inverse (i32 %x , i32 %y ) {
362
+ ; CHECK-LABEL: define i8 @scmp_from_select_eq_and_gt_inverse(
363
+ ; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
364
+ ; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.scmp.i8.i32(i32 [[X]], i32 [[Y]])
365
+ ; CHECK-NEXT: ret i8 [[R]]
366
+ ;
367
+ %ne = icmp ne i32 %x , %y
368
+ %gt = icmp sgt i32 %x , %y
369
+ %sel1 = select i1 %gt , i8 1 , i8 -1
370
+ %r = select i1 %ne , i8 %sel1 , i8 0
371
+ ret i8 %r
372
+ }
373
+
361
374
define <4 x i8 > @scmp_from_select_eq_and_gt_vec (<4 x i32 > %x , <4 x i32 > %y ) {
362
375
; CHECK-LABEL: define <4 x i8> @scmp_from_select_eq_and_gt_vec(
363
376
; CHECK-SAME: <4 x i32> [[X:%.*]], <4 x i32> [[Y:%.*]]) {
You can’t perform that action at this time.
0 commit comments