[PATCH] D137889: [LoongArch] Add support for tail call

wanglei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 12 01:40:32 PST 2022


wangleiat created this revision.
wangleiat added reviewers: SixWeining, xen0n, xry111, gonglingqin, MaskRay.
Herald added subscribers: StephenFan, luismarques, s.egerton, PkmX, simoncook, hiraditya, arichardson.
Herald added a project: All.
wangleiat requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

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.

Change-Id: I8d9b21db40e3da84c416e10114c55daa40f01de6


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137889

Files:
  llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
  llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
  llvm/lib/Target/LoongArch/LoongArchISelLowering.h
  llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
  llvm/lib/Target/LoongArch/LoongArchRegisterInfo.td
  llvm/test/CodeGen/LoongArch/codemodel-medium.ll
  llvm/test/CodeGen/LoongArch/tail-calls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137889.474934.patch
Type: text/x-patch
Size: 21588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221112/e08cb8a5/attachment-0001.bin>


More information about the llvm-commits mailing list