[RISCV] Improve vector fceil/ffloor lowering by changing FRM.
authorCraig Topper <craig.topper@sifive.com>
Tue, 6 Sep 2022 02:03:44 +0000 (19:03 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 6 Sep 2022 02:03:44 +0000 (19:03 -0700)
commitf0332d12aeecf08420f2595e4b07a71849c931e3
treeddf0082f9743351195799d84eb2d37a9234b27f9
parent067aab0a854634fef80958aede1e27abd8d244c0
[RISCV] Improve vector fceil/ffloor lowering by changing FRM.

This adds new VFCVT pseudoinstructions that take a rounding mode operand. A custom inserter is used to insert additional instructions to change FRM around the
VFCVT.

Some of this is borrowed from D122860, but takes a somewhat different direction. We may migrate to that patch, but for now I was trying to keep this as independent from
RVV intrinsics as I could.

A followup patch will use this approach for FROUND too.

Still need to fix the cost model.

Reviewed By: arcbbb

Differential Revision: https://reviews.llvm.org/D133238
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
llvm/test/Analysis/CostModel/RISCV/fround.ll
llvm/test/CodeGen/RISCV/rvv/fceil-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/ffloor-sdnode.ll
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp.ll