[PATCH] D128310: [RISCV] Move vfma_vl+fneg_vl matching to DAG combine.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 16:34:07 PDT 2022


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

This patch adds 3 new _VL RISCVISD opcodes to represent VFMA_VL with
different portions negated. It also adds a DAG combine to peek
through FNEG_VL to create these new opcodes.

This is modeled after similar code from X86.

This makes the isel patterns more regular and reduces the size of
the isel table by ~37K.

The test changes look like regressions, but they point to a bug that
was already there. We aren't able to commute a masked FMA instruction
to improve register allocation because we always use a mask undisturbed
policy. Prior to this patch we matched two multiply operands in a
different order and hid this issue for these test cases, but a different
test still could have encountered it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128310

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
  llvm/test/CodeGen/RISCV/rvv/vfma-vp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128310.438864.patch
Type: text/x-patch
Size: 47932 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220621/1f4907a5/attachment.bin>


More information about the llvm-commits mailing list