[PATCH] D86480: [RISC-V] ADDI/ORI x, 0 should be as cheap as a move

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 11:34:04 PDT 2020


arichardson created this revision.
arichardson added reviewers: apazos, asb, jrtc27.
Herald added subscribers: llvm-commits, luismarques, sameer.abuasal, pzheng, s.egerton, lenary, Jim, jocewei, PkmX, jfb, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.
arichardson requested review of this revision.
Herald added a subscriber: MaskRay.

The isTriviallyRematerializable hook is only called for instructions that are
tagged as isAsCheapAsAMove. Since ADDI 0 is used for "mv" it should definitely
be marked with "isAsCheapAsAMove". This change avoids one stack spill in most of
the atomic-rmw.ll tests functions. It also avoids stack spills in two of our
out-of-tree CHERI tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86480

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
  llvm/test/CodeGen/RISCV/atomic-rmw.ll
  llvm/test/CodeGen/RISCV/calling-conv-ilp32-ilp32f-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-ilp32-ilp32f-ilp32d-common.ll
  llvm/test/CodeGen/RISCV/calling-conv-lp64-lp64f-lp64d-common.ll
  llvm/test/CodeGen/RISCV/vararg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86480.287457.patch
Type: text/x-patch
Size: 295840 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/be066dab/attachment-0001.bin>


More information about the llvm-commits mailing list