[llvm] 66d350a - [PowerPC][NFC] Pre-commit test case to prepare for patch to custom lower ssubo
Maryam Moghadas via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 28 07:47:04 PST 2024
Author: Maryam Moghadas
Date: 2024-11-28T10:37:03-05:00
New Revision: 66d350a01738c0c64a28b943af5e995a5fbc348d
URL: https://github.com/llvm/llvm-project/commit/66d350a01738c0c64a28b943af5e995a5fbc348d
DIFF: https://github.com/llvm/llvm-project/commit/66d350a01738c0c64a28b943af5e995a5fbc348d.diff
LOG: [PowerPC][NFC] Pre-commit test case to prepare for patch to custom lower ssubo
Added:
llvm/test/CodeGen/PowerPC/ssubo-32.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/PowerPC/ssubo-32.ll b/llvm/test/CodeGen/PowerPC/ssubo-32.ll
new file mode 100644
index 00000000000000..7a42007b8a11a9
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/ssubo-32.ll
@@ -0,0 +1,26 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-aix | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-aix | FileCheck %s
+
+define i1 @subovfi_i32(i32 noundef %a, i32 noundef %b, ptr %c) {
+; CHECK-LABEL: subovfi_i32:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: sub 6, 3, 4
+; CHECK-NEXT: cmpwi 1, 4, 0
+; CHECK-NEXT: cmpw 6, 3
+; CHECK-NEXT: li 3, 1
+; CHECK-NEXT: stw 6, 0(5)
+; CHECK-NEXT: creqv 20, 5, 0
+; CHECK-NEXT: isel 3, 0, 3, 20
+; CHECK-NEXT: blr
+entry:
+ %0 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %a, i32 %b)
+ %1 = extractvalue { i32, i1 } %0, 1
+ %2 = extractvalue { i32, i1 } %0, 0
+ store i32 %2, ptr %c, align 4
+ ret i1 %1
+}
+
+declare { i32, i1 } @llvm.ssub.with.overflow.i32(i32, i32)
+
More information about the llvm-commits
mailing list