[PATCH] D133849: [NFC] Pre commit test of PR57502

Sheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 03:59:50 PDT 2022


0x59616e created this revision.
Herald added a project: All.
0x59616e requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is a pre-commit test of #57502


https://reviews.llvm.org/D133849

Files:
  llvm/test/CodeGen/AArch64/pr57502.ll


Index: llvm/test/CodeGen/AArch64/pr57502.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/pr57502.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=aarch64 -o - %s | FileCheck %s
+
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+
+define void @trunc(ptr %addr, <4 x i64> %input) {
+; CHECK-LABEL: trunc:
+; CHECK:       // %bb.0:
+; CHECK-NEXT:    xtn v1.2s, v1.2d
+; CHECK-NEXT:    xtn v0.2s, v0.2d
+; CHECK-NEXT:    uzp1 v0.4h, v0.4h, v1.4h
+; CHECK-NEXT:    addv h0, v0.4h
+; CHECK-NEXT:    fmov w8, s0
+; CHECK-NEXT:    strb w8, [x0]
+; CHECK-NEXT:    ret
+  %var = trunc <4 x i64> %input to <4 x i8>
+  %res = call i8 @llvm.vector.reduce.add.v4i8(<4 x i8> %var)
+  store i8 %res, ptr %addr
+  ret void
+}
+
+declare i8 @llvm.vector.reduce.add.v4i8(<4 x i8>)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133849.460032.patch
Type: text/x-patch
Size: 927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220914/e448af1d/attachment.bin>


More information about the llvm-commits mailing list