[PATCH] D106273: [WIP] Improve code generation for vector_splice for Imm > 0

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 08:39:33 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:7431
+  if ((!Op.getConstantOperandAPInt(2).isNegative() &&
+       Ty.getVectorMinNumElements() > Op.getConstantOperandVal(2)) ||
+      Op.getConstantOperandAPInt(2) == -1)
----------------
sdesmalen wrote:
> Why is this condition relevant?
Just realised the why; it's because of the immediate range for EXT.

nit: the ranges overlap, so you can write:

  auto Idx = Op.getConstantOperandAPInt(2);
  if (Idx >= -1 && Idx < Ty.getVectorMinNumElements())
    return Op;
  return SDValue;



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106273



More information about the llvm-commits mailing list