[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
Wed Aug 3 17:41:53 PDT 2022


huangjd added inline comments.


================
Comment at: llvm/test/CodeGen/X86/musttail-struct.ll:41
+
+; Arguments of different sizes passed on stack.
+define dso_local i32 @testManyArgs(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8 %6, ptr byval(%struct.5xi32) %7) {
----------------
davidxl wrote:
> huangjd wrote:
> > davidxl wrote:
> > > is this the correct comment, or it is intended for a negative test (missing)?
> > This is just describing the purpose of the test. in x64 the first 6 are passed by register and the rest 2 are passed by stack
> Ok. Can you expand the comment a little more.
> 
> Can you also add a negative test?
I am not sure what should a negative test be in this case, since the front end rejects the code if "musttail" is applied on function call that can't be tail called. Also if tail call is not applied, the output assembly can be quite unpredictable (if someone else change anything else in codegen) since instructions can be shuffled. I have yet seen a negative test with tail call optimization


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131034/new/

https://reviews.llvm.org/D131034



More information about the llvm-commits mailing list