================
@@ -2974,6 +2974,11 @@ bool X86TargetLowering::isEligibleForSiblingCallOpt(
if (IsCalleeWin64 != IsCallerWin64)
return false;
+ // Do not optimize vararg calls with 6 arguments for LFI since LFI reserves
+ // %r11, meaning there will not be enough registers available.
+ if (Subtarget.isLFI() && ArgLocs.size() > 5)
+ return false;
----------------
zyedidia wrote:
I added a test case in `lfi-sibcall.ll` that demonstrates a case where register
allocation fails without this condition. I think the condition could probably
be tightened to also check for var-args -- I will double check that tomorrow.
https://github.com/llvm/llvm-project/pull/189569
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits