[PATCH] D99412: [AArch64][SVEIntrinsicOpts] Optimize tbl+dup into dup+extractelement

Joe Ellis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 01:32:01 PDT 2021


joechrisellis added a comment.

Hi, thank you for the patch! The optimisation seems sound to me -- just a few comments on the test side. 😄



================
Comment at: llvm/test/CodeGen/AArch64/sve-tbl-dupx.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -aarch64-sve-intrinsic-opts -dce < %s 2>%t | FileCheck %s
+; op2 = tbl(op1 dup_x(idx)) -> op2 = dup_x(extractelement(op1, idx))
----------------
I don't think `-dce` is necessary here.


================
Comment at: llvm/test/CodeGen/AArch64/sve-tbl-dupx.ll:3
+; RUN: opt -S -aarch64-sve-intrinsic-opts -dce < %s 2>%t | FileCheck %s
+; op2 = tbl(op1 dup_x(idx)) -> op2 = dup_x(extractelement(op1, idx))
+
----------------
Worth adding:

```
; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t
...
; If this check fails please read test/CodeGen/AArch64/README for instructions on how to resolve it.
; WARN-NOT: warning
```

To make sure your `2>%t` is used. This block can usually be found in SVE tests. 😄 


================
Comment at: llvm/test/CodeGen/AArch64/sve-tbl-dupx.ll:89
+
+declare <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8( i8)
+declare <vscale x 8 x i16> @llvm.aarch64.sve.dup.x.nxv8i16(i16)
----------------
A few of these are unused at the minute. You can remove:

```
llvm.aarch64.sve.dup.x.nxv8f16
llvm.aarch64.sve.dup.x.nxv2f32
llvm.aarch64.sve.dup.x.nxv4f32
llvm.aarch64.sve.dup.x.nxv2f64

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99412/new/

https://reviews.llvm.org/D99412



More information about the llvm-commits mailing list