[PATCH] D98561: [RISCV] Support masked load/store for fixed vectors.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 15 09:57:37 PDT 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h:64
+
+  bool isLegalMaskedLoad(Type *DataType, Align Alignment) {
+    if (!ST->hasStdExtV())
----------------
frasercrmck wrote:
> Personal preference, but since this supports both load and store, for clarity we could make this a separate `isLegalMaskedLoadStore` and have `isLegalMaskedLoad` call that too?
> 
> Additionally, is "legality" here just that it shouldn't scalarize? Will the legalizer split too-wide vectors?
I believe the loop vectorizer calls this with a scalar type. There's a separate cost function too. The ScalarizeMaskedMemIntrinsic pass will call it with a fixed vector type to know if it needs to scalarize and insert conditional branches. The type legalizer in SelectionDAG can handle splitting, but not scalarizing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98561



More information about the llvm-commits mailing list