[PATCH] D54143: [WIP, RISCV] Generate address sequences suitable for mcmodel=medium

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 03:55:52 PST 2018


lewis-revill updated this revision to Diff 172915.
lewis-revill added a comment.

Deduplicate switch statements and error on an unsupported code model. Added a wrapper for loading the PC-relative address, which is expanded in `RISCVExpandPseudoInsts`. This approach is a compromise between splitting up into `auipc` and `addi` too early and blocking optimisations due to an additional basic block and splitting up too late and losing the chance to optimize the black box pseudo instruction.

By expanding at this point there is still the opportunity to do base-offset merges (when implemented) and other late machine-function passes, but the majority of larger optimisations such as outlining will have already taken place.

More changes are needed to fully implement this approach if it is suitable.


Repository:
  rL LLVM

https://reviews.llvm.org/D54143

Files:
  include/llvm/CodeGen/MachineBasicBlock.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/Target/RISCV/RISCVExpandPseudoInsts.cpp
  lib/Target/RISCV/RISCVISelLowering.cpp
  lib/Target/RISCV/RISCVISelLowering.h
  lib/Target/RISCV/RISCVInstrInfo.td
  lib/Target/RISCV/RISCVMCInstLower.cpp
  lib/Target/RISCV/Utils/RISCVBaseInfo.h
  test/CodeGen/RISCV/codemodel-lowering.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54143.172915.patch
Type: text/x-patch
Size: 15949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/ea7d18b7/attachment.bin>


More information about the llvm-commits mailing list