1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -instcombine -S | FileCheck %s
3
4define i64 @rem_unsigned(i64 %x1, i64 %y2) {
5; CHECK-LABEL: @rem_unsigned(
6; CHECK-NEXT:    [[R:%.*]] = urem i64 %x1, %y2
7; CHECK-NEXT:    ret i64 [[R]]
8;
9  %r = udiv i64 %x1, %y2
10  %r7 = mul i64 %r, %y2
11  %r8 = sub i64 %x1, %r7
12  ret i64 %r8
13}
14