Page MenuHomePhabricator

RegAllocFast: Record internal state based on register units

Authored by arsenm on Nov 9 2018, 4:37 PM.



Record internal state based on register units. This is often more
efficient as there is typically less register units to update compared
to iterating over all the aliases of a register.

Diff Detail

Event Timeline

MatzeB created this revision.Nov 9 2018, 4:37 PM
MatzeB added a comment.Nov 9 2018, 4:38 PM

This is part of my rewrite regallocfast series. See also D52010

arsenm accepted this revision.Nov 9 2018, 4:48 PM


This revision is now accepted and ready to land.Nov 9 2018, 4:48 PM

On its own this introduces assertions in some inline asm with tied operands testcases:
Assertion failed: (RegUnitStates[*UI] == VirtReg && "inverse map valid"), function dumpState, file ../lib/CodeGen/RegAllocFast.cpp,

This particular one no longer appears with all of the patches, although it seems there are some others.

Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2019, 4:25 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
arsenm commandeered this revision.Jul 31 2019, 6:40 PM
arsenm edited reviewers, added: MatzeB; removed: arsenm.
This revision now requires review to proceed.Jul 31 2019, 6:40 PM
arsenm updated this revision to Diff 212711.Jul 31 2019, 6:42 PM

Tests now all pass, except CodeGen/X86/2010-06-28-FastAllocTiedOperand.ll

This ends up allocating a physical register already implicitly def'd to a tied vreg operand. The subsequent patch fixes it, so I'm not sure it's worth much effort trying to extract the relevant parts from the other patch

qcolombet accepted this revision.Wed, Sep 4, 12:28 PM


Suggestion of a small refactoring below.


Maybe we can factor this code out into a verify kind of thing.
Like one that returns a bool that we wrap into an assert here and in the killVirtReg.

This revision is now accepted and ready to land.Wed, Sep 4, 12:28 PM