forked from OSchip/llvm-project
98f9389f65
To do this: 1. Add PseudoCALLIndirct to match indirect function call. 2. Add PseudoCALL to support parsing and print pseudo `call` in assembly 3. Expand PseudoCALL to the following form with R_RISCV_CALL relocation type while encoding: auipc ra, func jalr ra, ra, 0 If we expand PseudoCALL before emitting assembly, we will see auipc and jalr pair when compile with -S. It's hard for assembly parser to parsing this pair and identify it's semantic is function call and then insert R_RISCV_CALL relocation type. Although we could insert R_RISCV_PCREL_HI20 and R_RISCV_PCREL_LO12_I relocation types instead of R_RISCV_CALL. Due to RISCV relocation design, auipc and jalr pair only can relax to jal with R_RISCV_CALL + R_RISCV_RELAX relocation types. We expand PseudoCALL as late as encoding(RISCVMCCodeEmitter) instead of before emitting assembly(RISCVAsmPrinter) because we want to preserve call pseudoinstruction in assembly code. It's more readable and assembly parser could identify call assembly and insert R_RISCV_CALL relocation type. Differential Revision: https://reviews.llvm.org/D45859 llvm-svn: 330826 |
||
---|---|---|
.. | ||
AsmParser | ||
Disassembler | ||
InstPrinter | ||
MCTargetDesc | ||
TargetInfo | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
RISCV.h | ||
RISCV.td | ||
RISCVAsmPrinter.cpp | ||
RISCVCallingConv.td | ||
RISCVFrameLowering.cpp | ||
RISCVFrameLowering.h | ||
RISCVISelDAGToDAG.cpp | ||
RISCVISelLowering.cpp | ||
RISCVISelLowering.h | ||
RISCVInstrFormats.td | ||
RISCVInstrFormatsC.td | ||
RISCVInstrInfo.cpp | ||
RISCVInstrInfo.h | ||
RISCVInstrInfo.td | ||
RISCVInstrInfoA.td | ||
RISCVInstrInfoC.td | ||
RISCVInstrInfoD.td | ||
RISCVInstrInfoF.td | ||
RISCVInstrInfoM.td | ||
RISCVMCInstLower.cpp | ||
RISCVMachineFunctionInfo.h | ||
RISCVRegisterInfo.cpp | ||
RISCVRegisterInfo.h | ||
RISCVRegisterInfo.td | ||
RISCVSubtarget.cpp | ||
RISCVSubtarget.h | ||
RISCVTargetMachine.cpp | ||
RISCVTargetMachine.h | ||
RISCVTargetObjectFile.cpp | ||
RISCVTargetObjectFile.h |