Page MenuHomePhabricator

Mips/GlobalISel: Use more standard call lowering infrastructure
ClosedPublic

Authored by arsenm on Jul 9 2021, 2:23 PM.

Details

Summary

This also fixes some missing implicit uses on call instructions, adds
missing G_ASSERT_SEXT/ZEXT annotations, and some missing outgoing
sext/zexts. This also fixes not respecting tablegen requested type
promotions.

This starts treating f64 passed in i32 GPRs as a type of custom
assignment, which restores some previously XFAILed tests. This is due
to getNumRegistersForCallingConv returns a static value, but in this
case it is context dependent on other arguments.

Most of the ugliness is reproducing a hack CC_MipsO32 uses in
SelectionDAG. CC_MipsO32 depends on a bunch of vectors populated from
the original IR argument types in MipsCCState. The way this ends up
working in GlobalISel is it only ends up inspecting the most recently
added vector element. I'm pretty sure there are cleaner ways to do
this, but this seemed easier than fixing up the current DAG
handling. This is another case where it would be easier of the
CCAssignFns were passed the original type instead of only the
pre-legalized ones.

There's still a lot of junk here that shouldn't be necessary. This
also likely breaks big endian handling, but it wasn't complete/tested
anyway since the IRTranslator gives up on big endian targets.

Diff Detail

Unit TestsFailed

TimeTest
90 msx64 windows > LLVM.DebugInfo/X86::symbolize_function_start.s
Script: -- : 'RUN: at line 1'; rm -rf C:\ws\w16-1\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\symbolize_function_start.s.tmp

Event Timeline

arsenm created this revision.Jul 9 2021, 2:23 PM
arsenm requested review of this revision.Jul 9 2021, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2021, 2:23 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 357709.Jul 10 2021, 6:13 AM

Remove custom assignValueToReg code. Most of this is now handled in the custom handler

arsenm updated this revision to Diff 357711.Jul 10 2021, 6:22 AM

Missed more dead code

arsenm updated this revision to Diff 357712.Jul 10 2021, 6:28 AM

Remove most of assignValueToAddress

This revision is now accepted and ready to land.Jul 12 2021, 12:29 AM