[llvm] [NFC ]Add a helper function isTailCall for getting libcall in SelectionDAG (PR #155256)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 21:29:05 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);
----------------
arsenm wrote:

This will always return false for a null CallInst, but you have 2 null checks on it. Tail call should be possible even without the CallInst? I thought we handled tail call of new calls already?

At least turn into early exit or pull the null checks into the caller 

https://github.com/llvm/llvm-project/pull/155256


More information about the llvm-commits mailing list