[PATCH] D105417: [RISCV] Teach RISCVMatInt about cases where it can use LUI+SLLI to replace LUI+ADDI+SLLI for large constants.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 17:00:38 PDT 2021


craig.topper updated this revision to Diff 359963.
craig.topper added a comment.
This revision is now accepted and ready to land.

Use portions of D106318 <https://reviews.llvm.org/D106318>. I added a new flag to the cost function so that the call site in RISCVTargetTransformInfo for immediate cost isn't affected. This new cost model only seems useful for comparing two sequences, but that's not what immediate cost is doing.

I eft out the optsize since that wasn't needed for the current regression.
And I left out the parts for choosing different alternatives for the same constant
as it wasn't directly related to the goal of this change either.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105417/new/

https://reviews.llvm.org/D105417

Files:
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/add-before-shl.ll
  llvm/test/CodeGen/RISCV/double-mem.ll
  llvm/test/CodeGen/RISCV/float-mem.ll
  llvm/test/CodeGen/RISCV/half-mem.ll
  llvm/test/CodeGen/RISCV/imm.ll
  llvm/test/CodeGen/RISCV/rv64-large-stack.ll
  llvm/test/CodeGen/RISCV/rv64zbp.ll
  llvm/test/CodeGen/RISCV/rvv/constant-folding.ll
  llvm/test/CodeGen/RISCV/urem-lkk.ll
  llvm/test/MC/RISCV/rv64i-aliases-valid.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105417.359963.patch
Type: text/x-patch
Size: 18356 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/ddabd0c8/attachment-0001.bin>


More information about the llvm-commits mailing list