[PATCH] D44886: [RISCV] Support linker relax function call from auipc and jalr to jal

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 25 18:32:25 PDT 2018


shiva0217 created this revision.
shiva0217 added reviewers: asb, apazos.
Herald added subscribers: kito-cheng, niosHD, sabuasal, jordy.potman.lists, simoncook, johnrusso, rbar.

To do this:

1. Add fixup_riscv_call and fixup_riscv_relax fixup types which eventually will transfer to R_RISCV_CALL and R_RISCV_RELAX relocation types.

2. Deine FeatureRelax to enable/disable linker relaxation.

3. Add VK_RISCV_CALL_HI and VK_RISCV_CALL_LO RISCVMCExpr to recognize the function call expression.

4. Leave relocation types when linker relaxation enabled.

5. Insert R_RISCV_CALL and R_RISCV_RELAX relocation types to auipc function call expression when linker relaxation enabled.


Repository:
  rL LLVM

https://reviews.llvm.org/D44886

Files:
  lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVFixupKinds.h
  lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp
  lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.h
  lib/Target/RISCV/RISCV.td
  lib/Target/RISCV/RISCVAsmPrinter.cpp
  lib/Target/RISCV/RISCVSubtarget.h
  test/CodeGen/RISCV/linker-relaxation.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44886.139755.patch
Type: text/x-patch
Size: 7408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180326/2329dcf3/attachment.bin>


More information about the llvm-commits mailing list