2 Commits

Author SHA1 Message Date
wanglei
6971c1b370 [LoongArch] Add support for tail call optimization
This patch adds tail call support to the LoongArch backend.  When
appropriate, use the `b` or `jr` instruction for tail calls (the
`pcalau12i+jirl` instruction pair when use medium codemodel).

This patch also modifies the inappropriate operand name:
simm26_bl -> simm26_symbol

This has been modeled after RISCV's tail call opt.

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D137889
2022-11-19 17:36:06 +08:00
wanglei
882ddab4c0 [LoongArch] Generate PCALAU12I + JIRL instruction pair for medium codemodel
In LoongArch, when `CodeModel=Medium`, it just increases the jumping
ability of function calls relative to PC, from 2^28 to 2^32.

Depends on D137393

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D137394
2022-11-11 18:26:51 +08:00