[PATCH] D93365: [RISCV] Add intrinsics for vmv.x.s and vmv.s.x

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 21:13:10 PST 2020


craig.topper created this revision.
craig.topper added reviewers: evandro, HsiangKai, khchen, arcbbb, frasercrmck, rogfer01.
Herald added subscribers: NickHung, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

This adds intrinsics for vmv.x.s and vmv.s.x.

I've used stricter type constraints on these intrinsics than what we've been doing on the arithmetic intrinsics so far. This will allow us to not need to pass the scalar type to the Intrinsic::getDeclaration call when creating these intrinsics. Because of this I had to add custom ISD opcodes for isel since type legalization of the scalar to XLenVT breaks the constraint. DAG ISel will inherit constraints from the intrinsics if we use them in an isel pattern. A custom ISD opcode for vmv.x.s was needed anyway in order to implement the change in computeNumSignBitsForTargetNode.

I also modified the MC layer description of these instructions to show the tied source/dest operand. This is different than what we do for masked instructions where we drop the tied source operand when converting to MC. But it is a more accurate description of the instruction. We can't do this for masked instructions since we use the same MC instruction for masked and unmasked. Tools like llvm-mca operate in the MC layer and rely on ins/outs and Uses/Defs for analysis so I don't know if we'll be able to maintain the current behavior for masked instructions. So I went with the accurate description here since it was easy.


https://reviews.llvm.org/D93365

Files:
  llvm/include/llvm/IR/IntrinsicsRISCV.td
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfoV.td
  llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
  llvm/test/CodeGen/RISCV/rvv/vmv.s.x-rv32.ll
  llvm/test/CodeGen/RISCV/rvv/vmv.s.x-rv64.ll
  llvm/test/CodeGen/RISCV/rvv/vmv.x.s-rv32.ll
  llvm/test/CodeGen/RISCV/rvv/vmv.x.s-rv64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93365.312096.patch
Type: text/x-patch
Size: 48986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201216/4df75137/attachment.bin>


More information about the llvm-commits mailing list