Page MenuHomePhabricator

[X86] Fold load with tail call more aggressively
Needs ReviewPublic

Authored by mejedi on May 2 2021, 2:11 AM.



Enable folding for tail calls with multiple arguments.

Fixes bugzilla issue 50042.

Diff Detail

Event Timeline

mejedi created this revision.May 2 2021, 2:11 AM
mejedi requested review of this revision.May 2 2021, 2:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2021, 2:11 AM
mejedi added inline comments.May 2 2021, 2:31 AM

This part I'm least happy about. It was copied verbatim from (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.

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.


Nit: This change is confusing. Maybe better to check all assemblys, or to use to generate it.