This patch adds support for generating calls through the procedure linkage table where required for a given ExternalSymbol or GlobalAddress callee.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp | ||
---|---|---|
1108 ↗ | (On Diff #176742) | Do we want to be parsing the @plt for things other than call/tail? PseudoLLA also takes a bare_symbol but @plt isn't valid. Currently we parse bar@plt as a valid bare symbol; however, GNU as will reject it with illegal operands (as I understand it, this is because it doesn't treat @ as part of a valid identifier). |
lib/Target/RISCV/RISCVSubtarget.cpp | ||
51 | This can be inlined in LowerCall, especially once the fno-plt stuff is gone, as it's the only user. | |
56 | This seems to be X86-specific in LLVM; do we really need this in RISC-V? Clang's test/CodeGen/noplt.c gives a normal call foo@plt when compiled with riscv64-linux-gnu-gcc -fpic -fno-plt, so I would remove this and the related code. |
lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp | ||
---|---|---|
1108 ↗ | (On Diff #176742) | Hmm, probably a good idea. I guess I'd have to add yet another operand type in RISCVInstrInfo. Checking Operands[0] for "call" or "tail" seems a bit hacky to me, but maybe it's a reasonable approach? |
lib/Target/RISCV/RISCVSubtarget.cpp | ||
56 | OK, that makes things a lot simpler for LowerCall then. Is there no case where calls need to be lowered using GOT? |
Rebased and added testing using -relocation-model=pic in 'calls.ll'. Also added a dso_local callee to 'calls.ll' since this affects whether PLT is used for PIC.
This can be inlined in LowerCall, especially once the fno-plt stuff is gone, as it's the only user.