[PATCH] D109371: [RISCV][RFC] Add LLVM support for RISC-V overlay system

Edward Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 10:20:08 PDT 2021


edward-jones updated this revision to Diff 374597.
edward-jones added a comment.
Herald added subscribers: achieveartificialintelligence, dexonsmith, jdoerfert.

I've tried to take into account most of the suggested changes into this update:

- Tidied up with clang-format
- Merge 'overlaycall' and 'overlaydata' into a single attribute, just 'overlay'
- Remove the assembler pseudo instruction and expand the calls into the overlay engine earlier during call lowering. This meant that I could simplify quite a bit. It also means implicit register use/defs aren't hidden by a instruction
- Fix up the tests
- Renamed the relocations to be prefixed with RISCV_OVLTOK or RISCV_OVLPLT. I think these names are a bit more descriptive. A OVLTOK reloc encodes a 'token' which only makes sense to the overlay system, whereas a OVLPLT is an address of a thunk which is used to handle indirect functions
- Use %ovltok_hi/%ovltok_lo/%ovlplt_lo/%ovlplt_hi/@ovlplt/@ovltok as modifiers when writing assembly

I still need to rebase this, and there are some more tests which need to be written. This patch also depends on having a way to encode the reserved register attributes in the attributes in the ELF, but AFAIK there's no patch for that functionality yet.


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

https://reviews.llvm.org/D109371

Files:
  llvm/include/llvm/BinaryFormat/ELFRelocs/RISCV.def
  llvm/include/llvm/IR/Attributes.td
  llvm/include/llvm/MC/MCExpr.h
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/IR/Attributes.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/MC/MCExpr.cpp
  llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp
  llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.h
  llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.h
  llvm/lib/Target/RISCV/RISCVInstrInfo.td
  llvm/lib/Target/RISCV/RISCVMCInstLower.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/test/CodeGen/RISCV/overlay-calls.ll
  llvm/test/CodeGen/RISCV/overlay-sections.ll
  llvm/test/MC/RISCV/option-invalid.s
  llvm/test/MC/RISCV/overlay.s
  llvm/test/Transforms/Inline/RISCV/lit.local.cfg
  llvm/test/Transforms/Inline/RISCV/riscv-overlay-callee.ll
  llvm/test/Transforms/Inline/RISCV/riscv-overlay-caller.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109371.374597.patch
Type: text/x-patch
Size: 42781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210923/89dca774/attachment-0001.bin>


More information about the llvm-commits mailing list