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

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 00:16:26 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:561
+  Value *LHS, *RHS;
+  if (match(Vec, m_OneUse(m_BinOp(m_Value(LHS), m_Value(RHS)))) &&
+      (isSplatValue(LHS) || isSplatValue(RHS))) {
----------------
Is this always guaranteed to be safe? Could one of the lanes have previously generated an exception that we have now dropped?


================
Comment at: llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-lasta-lastb.ll:186
+  %splat = shufflevector <vscale x 16 x i8> %splat_insert, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
+  %binop = udiv <vscale x 16 x i8> %splat, %vector
+  %last = tail call i8 @llvm.aarch64.sve.lastb.nxv16i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %binop)
----------------
It might be worth having a FP binary operator test too here, since the `m_BinOp` match covers those as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106932



More information about the llvm-commits mailing list