[PATCH] D154687: [RISCV] Narrow types of index operand matched pattern (shl (zext), C).

Yeting Kuo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 04:56:03 PDT 2023


fakepaper56 marked an inline comment as done.
fakepaper56 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:10634
+  SDValue Src = N0.getOperand(0);
+  MVT SrcVT = Src.getSimpleValueType();
+  unsigned SrcElen = SrcVT.getScalarSizeInBits();
----------------
craig.topper wrote:
> Can we guarantee Src has an MVT type here? The intrinsic could be used with an illegal zext input type before type legalization.
I replaced MVT with EVT.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:10635
+  MVT SrcVT = Src.getSimpleValueType();
+  unsigned SrcElen = SrcVT.getScalarSizeInBits();
+  unsigned ShAmtV = ShAmt.getZExtValue();
----------------
craig.topper wrote:
> Can SrcElen be 1 if the input is a mask type before we legalize zero_extend?
I think it is acceptable after not using MVT.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154687



More information about the llvm-commits mailing list