[all-commits] [llvm/llvm-project] 86d282: [RISCV] Add intrinsics for vmv.x.s and vmv.s.x

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Dec 18 10:31:47 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 86d282baede58f675ea6df8d64bfee582b6679b7
      https://github.com/llvm/llvm-project/commit/86d282baede58f675ea6df8d64bfee582b6679b7
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2020-12-18 (Fri, 18 Dec 2020)

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

  Log Message:
  -----------
  [RISCV] Add intrinsics for vmv.x.s and vmv.s.x

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.

A custom ISD is used for vmv.x.s in order to implement the change in computeNumSignBitsForTargetNode which can remove sign extends on the result.

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.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D93365




More information about the All-commits mailing list