Page MenuHomePhabricator

RegAllocFast: Record internal state based on register units
AcceptedPublic

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

Details

Summary

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

Repository
rL LLVM

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

LGTM

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.Sep 4 2019, 12:28 PM

LGTM.

Suggestion of a small refactoring below.

lib/CodeGen/RegAllocFast.cpp
412

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.Sep 4 2019, 12:28 PM