[PATCH] D65947: [RISCV] Allow ABI Names in Inline Assembly Constraints

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 06:25:53 PDT 2019


lenary created this revision.
lenary added reviewers: asb, simoncook.
Herald added subscribers: llvm-commits, s.egerton, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, MaskRay, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, apazos, JDevlieghere, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.
lenary edited the summary of this revision.

Clang will replace references to registers using ABI names in inline
assembly constraints with references to architecture names, but other
frontends do not. LLVM uses the regular assembly parser to parse inline asm,
so inline assembly strings can contain references to registers using their
ABI names.

This patch adds support for parsing constraints using either the ABI name or
the architectural register name. This means we do not need to implement the
ABI name replacement code in every single frontend, especially those like
Rust which are a very thin shim on top of LLVM IR's inline asm, and that
constraints can more closely match the assembly strings they refer to.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65947

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/inline-asm-abi-names.ll
  llvm/test/CodeGen/RISCV/inline-asm-d-abi-names.ll
  llvm/test/CodeGen/RISCV/inline-asm-d-constraint-f.ll
  llvm/test/CodeGen/RISCV/inline-asm-f-abi-names.ll
  llvm/test/CodeGen/RISCV/inline-asm-f-constraint-f.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65947.214133.patch
Type: text/x-patch
Size: 148342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/4d05763a/attachment-0001.bin>


More information about the llvm-commits mailing list