[PATCH] D106932: [AArch64][SVE][InstCombine] Move last{a,b} before binop if one operand is a splat value

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 07:54:03 PDT 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-lasta-lastb.ll:276-346
+define i8 @lastb_binop_RHS_splat_add(<vscale x 16 x i1> %pg, i8 %scalar, <vscale x 16 x i8> %vector) #0 {
+; OPT-LABEL: @lastb_binop_RHS_splat_add(
+; OPT-NEXT:    %1 = call i8 @llvm.aarch64.sve.lastb.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %vector)
+; OPT-NEXT:    %binop1 = add i8 %1, %scalar
+; OPT-NEXT:    ret i8 %binop1
+  %splat_insert = insertelement <vscale x 16 x i8> poison, i8 %scalar, i32 0
+  %splat = shufflevector <vscale x 16 x i8> %splat_insert, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
----------------
Given you have div and div tests with and without flags, do these add/fadd tests testing anything new? If not then there's not much point keeping them.


================
Comment at: llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-lasta-lastb.ll:348
+
+define i8 @lastb_binop_LHS_RHS_splat_add(<vscale x 16 x i1> %pg, i8 %scalar1, i8 %scalar2) #0 {
+; OPT-LABEL: @lastb_binop_LHS_RHS_splat_add(
----------------
I was going to group this test with the above comment but looking at the output there is no transformation.  Is this intended? I would have expected a scalar `add`.


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

https://reviews.llvm.org/D106932



More information about the llvm-commits mailing list