[llvm] [RISCV] Implement tail call optimization in machine outliner (PR #115297)
Mark Goncharov via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 23:56:53 PST 2024
================
@@ -2961,6 +2990,17 @@ RISCVInstrInfo::getOutliningCandidateInfo(
for (auto &MI : RepeatedSequenceLocs[0])
SequenceSize += getInstSizeInBytes(MI);
+ if (!cannotInsertTailCall(RepeatedSequenceLocs[0].back())) {
+ // tail function = 8 bytes. Can't be compressed
----------------
mga-sc wrote:
Rewrote it in a more precise form
```cpp
// tail call = auipc + jalr in the worst case without linker relaxation.
CallOverhead = 4 + InstrSizeCExt;
```
https://github.com/llvm/llvm-project/pull/115297
More information about the llvm-commits
mailing list