[PATCH] D108987: [RISCV][VP] Custom lower VP_SCATTER and VP_GATHER

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 23:27:48 PDT 2021


rogfer01 accepted this revision.
rogfer01 added a comment.
This revision is now accepted and ready to land.

LGTM! Thanks @frasercrmck !



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:6447
       // TODO: Sanitize the scale operand here?
+      // TODO: For VP nodes, should we use VP_SHL here?
       assert(isPowerOf2_32(Scale) && "Expecting power-of-two types");
----------------
I'd say so. Using `ISD::SHL` causes the emission of a `vsetvli` to switch to `vlmax` temporarily. I understand we can do this in a later patch as it seems a low hanging fruit.

(That said I understand this as part of a deeper problem by itself: `gep`s used to synthesize the vector of pointers fed to `vp.{gather,scatter}` will be already be broken down by DAGBuilder in `vlmax` operations. My wild guess here is that we need something like "demandedvectorelements" but aware of "vlmax" vs "not vlmax").


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108987



More information about the llvm-commits mailing list