[PATCH] D122743: [RISCV][VP] Add basic RVV codegen for vp.icmp

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 09:32:25 PDT 2022


frasercrmck created this revision.
frasercrmck added reviewers: craig.topper, rogfer01, arcbbb.
Herald added subscribers: sunshaoce, VincentWu, luke957, StephenFan, vkmr, dexonsmith, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
frasercrmck requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

This patch adds the minimum required to successfully lower vp.icmp via
the new ISD::VP_SETCC node to RVV instructions.

Regular ISD::SETCC goes through a lot of canonicalization which targets
may rely on which has not hereto been ported to VP_SETCC. It also
supports expansion of individual condition codes and a non-boolean
return type. Support for all of that will follow in later patches.

In the case of RVV this largely isn't a problem as the vector integer
comparison instructions are plentiful enough that it can lower all
VP_SETCC nodes on legal integer vectors except for boolean vectors,
which regular SETCC folds away immediately into logical operations.

Floating-point VP_SETCC operations aren't as well supported in RVV and
the backend relies on condition code expansion, so support for those
operations will come in later patches.

Portions of this code were taken from the VP reference patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122743

Files:
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/include/llvm/IR/VPIntrinsics.def
  llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
  llvm/test/CodeGen/RISCV/rvv/setcc-int-vp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122743.419183.patch
Type: text/x-patch
Size: 210273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220330/d9c3d65c/attachment-0001.bin>


More information about the llvm-commits mailing list