[PATCH] D125950: [LegalizeTypes][VP] Add widen and split support for VP_TRUNCATE

WangLian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 00:05:08 PDT 2022


Jimerlife added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:3405
   // to split more than once.
+  // FIXME: VP_TRUNCATE only implement SplitVecOp_UnaryOp for RISCV. But to
+  // other Targets maybe need to special handle in this functions.
----------------
frasercrmck wrote:
> I don't follow this comment, I'm afraid. Is it saying that other targets may need special target-specific handling in `SplitVeOp_UnaryOp` for `VP_TRUNCATE`? I'd prefer to avoid mentioning targets in SelectionDAG if it can be helped - this is meant to be target-agnostic code.
What I meant is now only implement SplitVeOp_UnaryOp for VP_TRUNCATE. In this SplitVecOp_TruncateHelper method , I cann't write a RISCV test trigger the code from line 3425 to end, so I do nothing in this part of code.Maybe other Targets should do special handle VP_TRUNCATE in this part of code.
Angway, I remove this comment, Thank you.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:4209
+      if (N->getNumOperands() == 3) {
+        SDValue Mask =
+            GetWidenedMask(N->getOperand(1), WidenVT.getVectorElementCount());
----------------
frasercrmck wrote:
> Maybe an assert like `ISD::isVPOpcode`? here?
You right. Add an assert to confirm it's VPOpcode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125950



More information about the llvm-commits mailing list