[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 19:20:40 PDT 2019


Jim marked an inline comment as done.
Jim added inline comments.


================
Comment at: lib/Target/RISCV/RISCVISelLowering.cpp:1966
 
-  // Do not tail call opt functions with varargs.
-  if (IsVarArg)
----------------
luismarques wrote:
> @Jim you say in a review comment that "If the varargs are all passed by registers, it can do tail call opt." but this comment just says that functions with varargs cannot be tail call optimized.
@luismarques I think this comment is incorrect. If no arguments are passed via the stack, it should be allowed to be tail-call-optimised. Whether the function is with varargs or not isn't the condition to decide to do tail-call-opt. We can treat the function with varargs the same as the function without varargs 


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