[PATCH] D66278: [RISCV] Enable tail call opt for variadic function

Jim Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 20:31:57 PDT 2019


Jim added a comment.

@lenary 
If any arguments are passed by the stack, it is not allowed to do tail-call-opt. 
Because the caller would allocate the stack for passing the arguments, and need to 
free the stack after the call finished (the call must return back for free the stack).

The only difference on passing the varargs is that 2xXLen argument need to 
be assigned an 'even' or 'aligned' register (8-byte alignment for RV32 or 16-byte alignment for RV64).
So the function with varargs is allowed to be tail-call-optimised if no arguments are passed via the stack.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66278





More information about the llvm-commits mailing list