diff options
author | Fangrui Song <i@maskray.me> | 2022-07-07 10:18:45 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-07-07 10:18:45 -0700 |
commit | 75e551e5d830754104f5cce8c7a97b69e56aac7d (patch) | |
tree | 50f974f4782298b4639819ca42a57fbf898e4b38 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | b15127d0562cd6e1fc65abc1e967c56fa18391a7 (diff) | |
download | llvm-75e551e5d830754104f5cce8c7a97b69e56aac7d.zip llvm-75e551e5d830754104f5cce8c7a97b69e56aac7d.tar.gz llvm-75e551e5d830754104f5cce8c7a97b69e56aac7d.tar.bz2 |
[ELF] Relax R_RISCV_CALL and R_RISCV_CALL_PLT
A pair of auipc+jalr relocated by R_RISCV_CALL or R_RISCV_CALL_PLT can be
converted to c.j, c.jal, or jal.
* c.j: RVC and displacement is representable as an int12
* c.jal: RV32C and displacement is representable as an int12
* jal: displacement is representable as an int21
Use the D127581 relaxation framework to implement the relaxation. If a shorter
sequence is satisfied, we record the new relocation type in `relocTypes` and
saves the new instruction into `writes`. Finally let `riscvFinalizeRelax` rewrite the
instruction by setting `skip`.
Differential Revision: https://reviews.llvm.org/D127611
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions