[llvm] [NFC ]Add a helper function isTailCall for getting libcall in SelectionDAG (PR #155256)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 10:22:52 PDT 2025
================
@@ -9012,6 +9012,14 @@ static void checkAddrSpaceIsValidForLibcall(const TargetLowering *TLI,
}
}
+static bool isTailCall(const CallInst *CI, const SelectionDAG *SelDAG,
+ bool IsLowerToLibCall) {
+ bool ReturnsFirstArg = CI && funcReturnsFirstArgOfCall(*CI);
+ return CI && CI->isTailCall() &&
+ isInTailCallPosition(*CI, SelDAG->getTarget(),
+ ReturnsFirstArg && IsLowerToLibCall);
----------------
RolandF77 wrote:
True, we don't want to start tail calling where we didn't before in an NFC patch, but we can still clean this up a little. I suggest putting in a TODO: fix returns first arg determination and changing the name of the helper parameter to something like AllowReturnsFirstArg. Also put the check for the flag first so short circuit evaluation skips calling the function.
https://github.com/llvm/llvm-project/pull/155256
More information about the llvm-commits
mailing list