[PATCH] D105509: [RISCV] Teach constant materialization that it can use zext.w at the end with Zba to reduce number of instructions.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 13:23:31 PDT 2021


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

If the upper 32 bits are zero and bit 31 is set, we might be able to
use zext.w to fill in the zeros after using an lui and/or addi.

Most of this patch is plumbing the subtarget features into the constant
materialization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105509

Files:
  llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
  llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
  llvm/test/CodeGen/RISCV/rv64zba.ll
  llvm/test/MC/RISCV/rv64b-aliases-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105509.356811.patch
Type: text/x-patch
Size: 14447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210706/367b5308/attachment.bin>


More information about the llvm-commits mailing list