This commit is contained in:
Diana Picus 2025-08-18 12:13:45 +02:00
parent b0fb6a7e2b
commit d39acfa3ba

View File

@ -7983,6 +7983,8 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
I.getArgOperand(Idx)->getType()); I.getArgOperand(Idx)->getType());
Arg.setAttributes(&I, Idx); Arg.setAttributes(&I, Idx);
// If we have an explicit sret argument that is an Instruction, (i.e., it
// might point to function-local memory), we can't meaningfully tail-call.
if (Arg.IsSRet && isa<Instruction>(I.getArgOperand(Idx))) if (Arg.IsSRet && isa<Instruction>(I.getArgOperand(Idx)))
isTailCall = false; isTailCall = false;