1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=div-rem-pairs -S -mtriple=aarch64-unknown-unknown | FileCheck %s
4 define i8 @f(ptr %p, i8 %x, i8 %y) {
6 ; CHECK-NEXT: [[X_FROZEN:%.*]] = freeze i8 [[X:%.*]]
7 ; CHECK-NEXT: [[Y_FROZEN:%.*]] = freeze i8 [[Y:%.*]]
8 ; CHECK-NEXT: [[XDIVY:%.*]] = udiv i8 [[X_FROZEN]], [[Y_FROZEN]]
9 ; CHECK-NEXT: [[TMP1:%.*]] = mul i8 [[XDIVY]], [[Y_FROZEN]]
10 ; CHECK-NEXT: [[XMODY_DECOMPOSED:%.*]] = sub i8 [[X_FROZEN]], [[TMP1]]
11 ; CHECK-NEXT: store i8 [[XMODY_DECOMPOSED]], ptr [[P:%.*]], align 1
12 ; CHECK-NEXT: ret i8 [[XDIVY]]
14 %xmody = urem i8 %x, %y
15 %xdivy = udiv exact i8 %x, %y
16 store i8 %xmody, ptr %p, align 1