[PATCH] D113890: [RISCV] Add new ELF attribute to track reserved registers

Edward Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 06:52:42 PST 2021


edward-jones created this revision.
Herald added subscribers: VincentWu, luke957, achieveartificialintelligence, vkmr, frasercrmck, dexonsmith, jdoerfert, evandro, luismarques, apazos, sameer.abuasal, simoncook, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, zzheng, jrtc27, kito-cheng, niosHD, sabuasal, johnrusso, rbar, asb, hiraditya.
edward-jones requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

This attribute is described in this pull request to the RISCV psABI: New attribute: Tag_RISCV_reserved_register <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/195>

This adds a new attribute used to record reserved register information. This is used to check compatibility between ABI subvariants like overlay which reserve registers for use in the overlay engine.

Currently this is limited to only the x0-x31 range of registers. At the very least support for the floating point registers needs to be added, and in future this may also need to handle registers outside the available 64 bit mask (eg CSR or vector extension registers)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113890

Files:
  llvm/include/llvm/MC/MCELFStreamer.h
  llvm/include/llvm/Support/ELFAttributeParser.h
  llvm/include/llvm/Support/RISCVAttributes.h
  llvm/lib/MC/MCELFStreamer.cpp
  llvm/lib/Support/ELFAttributeParser.cpp
  llvm/lib/Support/RISCVAttributeParser.cpp
  llvm/lib/Support/RISCVAttributes.cpp
  llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h
  llvm/test/CodeGen/RISCV/attributes.ll
  llvm/test/MC/RISCV/attribute-reserved-regs.s
  llvm/test/MC/RISCV/attribute.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113890.387240.patch
Type: text/x-patch
Size: 27070 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211115/c68d8fb2/attachment.bin>


More information about the llvm-commits mailing list