[PATCH] D99509: [RISCV] Add legality check for vectoring reduction

Luke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 09:23:00 PDT 2021


luke957 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h:132
+                                   ElementCount VF) const {
+    if (!VF.isScalable())
+      return true;
----------------
frasercrmck wrote:
> We support the fixed-length vector reductions. Can we add support for that too?
Can we just retrun true when VF is not scalable to support fixed-length vector reductions?


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h:133
+    if (!VF.isScalable())
+      return true;
+
----------------
craig.topper wrote:
> This is returning true for not scalable. Is that saying that any fixed length reduction is supported?
I understand returning true for not scalable is just to make canVectorizeReductions() in  LoopVectorizer.cpp return right value. There will be other checks after canVectorizeReductions() returns.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99509



More information about the llvm-commits mailing list