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.
Details
Diff Detail
Event Timeline
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.
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
LGTM.
Suggestion of a small refactoring below.
lib/CodeGen/RegAllocFast.cpp | ||
---|---|---|
434 ↗ | (On Diff #212711) | Maybe we can factor this code out into a verify kind of thing. |
Rebase and fix the one remaining failure in test/CodeGen/X86/2010-06-28-FastAllocTiedOperand.ll, so now this patch no longer introduces an intermediate broken step before D52010.
The problem was the spilling was dropped from handleThroughOperands in the physdef collision loop. Restored the definePhysReg call with the new regunit iterator checks instead of using the reg alias iterator
Posted final revision to help post-commit review. The previous revision was accepted, and in order to escape the 2 year deadlock on this set of patches, I've committed this as 66251f7e1de79a7c1620659b7f58352b8c8e892e
llvm/lib/CodeGen/RegAllocFast.cpp | ||
---|---|---|
136 | This seems to be unused? gcc warns with ../lib/CodeGen/RegAllocFast.cpp:245:6: warning: 'bool {anonymous}::RegAllocFast::isPhysRegFree(llvm::MCPhysReg) const' defined but not used [-Wunused-function] ^~~~~~~~~~~~ Will it be used soon or can it be removed? |
llvm/lib/CodeGen/RegAllocFast.cpp | ||
---|---|---|
136 | Removed |
This seems to be unused? gcc warns with
../lib/CodeGen/RegAllocFast.cpp:245:6: warning: 'bool {anonymous}::RegAllocFast::isPhysRegFree(llvm::MCPhysReg) const' defined but not used [-Wunused-function]
bool RegAllocFast::isPhysRegFree(MCPhysReg PhysReg) const {
Will it be used soon or can it be removed?