Enable folding for tail calls with multiple arguments.
Fixes bugzilla issue 50042.
Paths
| Differential D101718
[X86] Fold load with tail call more aggressively AcceptedPublic Authored by mejedi on May 2 2021, 2:11 AM.
Details
Summary Enable folding for tail calls with multiple arguments. Fixes bugzilla issue 50042.
Diff Detail
Event Timeline
Comment Actions I don't find any problem in the tests. So I think it looks good. But I'm not familiar with call lowering, I'd like others to sign off.
Comment Actions LGTM. Let me know if you need help for committing the patch.
This revision is now accepted and ready to land.Jul 1 2023, 6:05 PM
Revision Contents
Diff 342227 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/cfguard-checks.ll
llvm/test/CodeGen/X86/musttail-varargs.ll
llvm/test/CodeGen/X86/sibcall-4.ll
llvm/test/CodeGen/X86/tailcall-64.ll
|
This part I'm least happy about. It was copied verbatim from X86InstrCompiler.td (X86tcret_6regs).
TBH, I don't fully understand the implications of moving LOAD close to TC_RETURN. It looks safe. However, if this check is omitted, we can end up moving the LOAD and not folding it. This is causing malformed DAG during scheduling in test/CodeGen/X86/musttail-varargs.ll, can't figure why.