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

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 04:20:43 PDT 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/sve-tbl-dupx.ll:12
+; CHECK-LABEL: @dup_ext_i8(
+; CHECK-NEXT:    [[TMP:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.dup.x.nxv16i8(i8 1)
+; CHECK-NEXT:    [[TMP1:%.*]] = extractelement <vscale x 16 x i8> [[DATA:%.*]], i8 1
----------------
This shows what I meant by my previous comment in that all the tests check for this stray instruction and so it seem preferable to me for SVEIntrinsicOpts to remove it when it's knowingly no longer used.


================
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))
+
----------------
joechrisellis wrote:
> 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. 😄 
Not a problem for this patch but for information once D98856 lands this practice will no longer be needed as the key warning will error by default for opt/llc tests.


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

https://reviews.llvm.org/D99412



More information about the llvm-commits mailing list