[PATCH] D131034: [Backend][X86] Improved tail call optimization for functions marked as musttail

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 17:12:48 PDT 2022


huangjd created this revision.
huangjd added a reviewer: davidxl.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
huangjd requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Now check if a function call marked as musttail also qualifies as a sibcall,
which means on-stack arguments are already in place before handling the
tail call function.

This also suppress a bug when a musttail call has struct arguments
passed on the stack, the output code results in return address
overwriting. See https://github.com/llvm/llvm-project/issues/56891


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131034

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/musttail-struct.ll
  llvm/test/CodeGen/X86/musttail-tailcc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131034.449490.patch
Type: text/x-patch
Size: 5079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220803/ce5c6228/attachment.bin>


More information about the llvm-commits mailing list