File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,19 @@ define i8 @srem_XY_XZ_with_CY_gt_CZ_drop_nsw(i8 noundef %X) {
385385 ret i8 %r
386386}
387387
388+ define i8 @srem_XY_XZ_with_CY_gt_CZ_drop_nsw_commuted (i8 noundef %X ) {
389+ ; CHECK-LABEL: @srem_XY_XZ_with_CY_gt_CZ_drop_nsw_commuted(
390+ ; CHECK-NEXT: [[BO0:%.*]] = mul nsw i8 [[X:%.*]], 127
391+ ; CHECK-NEXT: [[BO1:%.*]] = shl nsw i8 [[X]], 7
392+ ; CHECK-NEXT: [[R:%.*]] = srem i8 [[BO0]], [[BO1]]
393+ ; CHECK-NEXT: ret i8 [[R]]
394+ ;
395+ %BO0 = mul nsw i8 %X , 127
396+ %BO1 = shl nsw i8 %X , 7
397+ %r = srem i8 %BO0 , %BO1
398+ ret i8 %r
399+ }
400+
388401define i8 @srem_XY_XZ_with_CY_gt_CZ_fail_missing_flag1 (i8 %X ) {
389402; CHECK-LABEL: @srem_XY_XZ_with_CY_gt_CZ_fail_missing_flag1(
390403; CHECK-NEXT: [[BO0:%.*]] = mul nuw nsw i8 [[X:%.*]], 10
You can’t perform that action at this time.
0 commit comments