1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=sccp < %s -S | FileCheck %s
4 define i8 @ashr_to_lshr(i8 %x, i8 %y) {
5 ; CHECK-LABEL: define i8 @ashr_to_lshr(
6 ; CHECK-SAME: i8 [[X:%.*]], i8 [[Y:%.*]]) {
7 ; CHECK-NEXT: [[P:%.*]] = and i8 [[X]], 127
8 ; CHECK-NEXT: [[R:%.*]] = lshr exact i8 [[P]], [[Y]]
9 ; CHECK-NEXT: ret i8 [[R]]
12 %r = ashr exact i8 %p, %y
16 define i8 @sdiv_to_udiv(i8 %x, i8 %y) {
17 ; CHECK-LABEL: define i8 @sdiv_to_udiv(
18 ; CHECK-SAME: i8 [[X:%.*]], i8 [[Y:%.*]]) {
19 ; CHECK-NEXT: [[X1:%.*]] = and i8 [[X]], 127
20 ; CHECK-NEXT: [[Y1:%.*]] = and i8 [[Y]], 127
21 ; CHECK-NEXT: [[R:%.*]] = udiv exact i8 [[X1]], [[Y1]]
22 ; CHECK-NEXT: ret i8 [[R]]
26 %r = sdiv exact i8 %x1, %y1