[PATCH] D94894: [RISCV] Add way to mark CompressPats that should only be used for compressing.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 21:15:24 PST 2021


craig.topper created this revision.
craig.topper added reviewers: asb, luismarques, frasercrmck, evandro, HsiangKai.
Herald added subscribers: NickHung, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, 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.

There can be muliple patterns that map to the same compressed
instruction. Reversing those leads to multiple ways to uncompress
an instruction, but its not easily controllable which one will
be chosen by the tablegen backend.

This patch adds a flag to mark patterns that should only be used
for compressing. This allows us to leave one canonical pattern
for uncompressing.

The obvious benefit of this is getting c.mv to uncompress to
the addi patern that is aliased to the mv pseudoinstruction. For
the add/and/or/xor/li patterns it just removes some unreachable
code from the generated code.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94894

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoC.td
  llvm/test/TableGen/AsmPredicateCombiningRISCV.td
  llvm/utils/TableGen/RISCVCompressInstEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94894.317266.patch
Type: text/x-patch
Size: 4862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210118/fb2ae667/attachment.bin>


More information about the llvm-commits mailing list