llvm-project/llvm/lib
Shiva Chen 98f9389f65 [RISCV] Support "call" pseudoinstruction in the MC layer
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
2018-04-25 14:18:55 +00:00
..
Analysis [CaptureTracking] Fixup const correctness of DomTree arg (NFC) 2018-04-24 21:12:45 +00:00
AsmParser Add the ShadowCallStack attribute 2018-04-03 20:10:40 +00:00
BinaryFormat Fix build broken by r328090 2018-03-21 12:18:03 +00:00
Bitcode [IR] Upgrade comment token in objc retain release marker for asm call 2018-04-17 04:02:24 +00:00
CodeGen [DAGCombiner][X86] When promoting loads don't use ZEXTLOAD even its legal 2018-04-24 22:35:27 +00:00
DebugInfo [LLD/PDB] Emit first section contribution for DBI Module Descriptor. 2018-04-20 18:00:46 +00:00
Demangle [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00
ExecutionEngine [ORC] Fix an assertion condition from r329934. 2018-04-19 19:30:35 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR [LLVM-C] DIBuilder Bindings For Variable Expressions 2018-04-23 22:31:49 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO [LTO] Add stats-file option to LTO/Config.h. 2018-04-20 10:18:36 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [wasm] Fix uninitialized memory introduced in r330749. 2018-04-24 20:30:56 +00:00
Object [WebAssembly] Use section index in relocation section header 2018-04-24 18:11:36 +00:00
ObjectYAML [ObjectYAML] Add ability for DWARFYAML to calculate DIE lengths 2018-04-20 12:33:49 +00:00
Option [NFC] Replace iterators in PrintHelp with range-based for 2018-03-12 18:31:07 +00:00
Passes Re-land r329273: [Plugins] Add a slim plugin API to work together with the new PM 2018-04-05 15:04:13 +00:00
ProfileData [ProfileData] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:46:36 +00:00
Support [X86] Revert r330638 - accidental commit 2018-04-23 20:05:51 +00:00
TableGen Let TableGen write output only if it changed, instead of doing so in cmake. 2018-04-24 17:29:05 +00:00
Target [RISCV] Support "call" pseudoinstruction in the MC layer 2018-04-25 14:18:55 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode 2018-01-20 11:44:32 +00:00
Transforms [LoopInterchange] Use getExitBlock()/getExitingBlock instead of manual impl. 2018-04-25 09:35:54 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt