[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
Mon Apr 9 02:07:48 PDT 2018


shiva0217 added inline comments.


================
Comment at: test/CodeGen/RISCV/linker-relaxation.ll:8
+
+define i32 @test_call_external(i32 %a) nounwind {
+; RELAX-RELOC: R_RISCV_CALL external_function 0x0
----------------
asb wrote:
> I think we need to test the assembly output here, which will show that %pcrel_lo/%pcrel_hi are still emitted (and also checks that the asm emitter code doesn't crash when encountering VK_RISCV_CALL_LO). It's obviously unfortunate that generating .s and then assembling that will produce a different result (two relocations) than emitting the .o directly. Emitting the 'call` pseudoinstruction as used by gcc would fix that issue, but still leaves you with no way of expressing the "expanded" auipc+jalr form.
Hi Alex. Should we emit the `call` pseudo instruction as gcc to fix the issue? To do that, we could delay the function call expansion to encoding to preserve `call`. 


Repository:
  rL LLVM

https://reviews.llvm.org/D44886





More information about the llvm-commits mailing list