[llvm] c726b34 - Add a test for D144333
Juneyoung Lee via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 18 13:01:07 PST 2023
Author: Juneyoung Lee
Date: 2023-02-18T21:00:55Z
New Revision: c726b34ea01b74741dd9a6ae072e5ca4d9a3e623
URL: https://github.com/llvm/llvm-project/commit/c726b34ea01b74741dd9a6ae072e5ca4d9a3e623
DIFF: https://github.com/llvm/llvm-project/commit/c726b34ea01b74741dd9a6ae072e5ca4d9a3e623.diff
LOG: Add a test for D144333
Added:
llvm/test/Transforms/DivRemPairs/AArch64/div-rem-pairs.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/DivRemPairs/AArch64/div-rem-pairs.ll b/llvm/test/Transforms/DivRemPairs/AArch64/div-rem-pairs.ll
new file mode 100644
index 0000000000000..f7e0eaa9c9a14
--- /dev/null
+++ b/llvm/test/Transforms/DivRemPairs/AArch64/div-rem-pairs.ll
@@ -0,0 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=div-rem-pairs -S -mtriple=aarch64-unknown-unknown | FileCheck %s
+
+define i8 @f(ptr %p, i8 %x, i8 %y) {
+; CHECK-LABEL: @f(
+; CHECK-NEXT: [[X_FROZEN:%.*]] = freeze i8 [[X:%.*]]
+; CHECK-NEXT: [[Y_FROZEN:%.*]] = freeze i8 [[Y:%.*]]
+; CHECK-NEXT: [[XDIVY:%.*]] = udiv exact i8 [[X_FROZEN]], [[Y_FROZEN]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i8 [[XDIVY]], [[Y_FROZEN]]
+; CHECK-NEXT: [[XMODY_DECOMPOSED:%.*]] = sub i8 [[X_FROZEN]], [[TMP1]]
+; CHECK-NEXT: store i8 [[XMODY_DECOMPOSED]], ptr [[P:%.*]], align 1
+; CHECK-NEXT: ret i8 [[XDIVY]]
+;
+ %xmody = urem i8 %x, %y
+ %xdivy = udiv exact i8 %x, %y
+ store i8 %xmody, ptr %p, align 1
+ ret i8 %xdivy
+}
More information about the llvm-commits
mailing list