Kill and collapse outstanding DomainValues.

DomainValues that are only used by "don't care" instructions are now
collapsed to the first possible execution domain after all basic blocks
have been processed.  This typically means the PS domain on x86.

For example, the vsel_i64 and vsel_double functions in sse2-blend.ll are
completely collapsed to the PS domain instead of containing a mix of
execution domains created by isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144037 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2011-11-07 23:08:21 +00:00
parent a29fc806fe
commit b26c7727c9
8 changed files with 58 additions and 28 deletions

View File

@ -510,11 +510,20 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
leaveBasicBlock(MBB);
}
// Clear the LiveOuts vectors. Should we also collapse any remaining
// DomainValues?
for (LiveOutMap::const_iterator i = LiveOuts.begin(), e = LiveOuts.end();
i != e; ++i)
delete[] i->second;
// Clear the LiveOuts vectors and collapse any remaining DomainValues.
for (ReversePostOrderTraversal<MachineBasicBlock*>::rpo_iterator
MBBI = RPOT.begin(), MBBE = RPOT.end(); MBBI != MBBE; ++MBBI) {
LiveOutMap::const_iterator FI = LiveOuts.find(*MBBI);
if (FI == LiveOuts.end())
continue;
assert(FI->second && "Null entry");
// The DomainValue is collapsed when the last reference is killed.
LiveRegs = FI->second;
for (unsigned i = 0, e = NumRegs; i != e; ++i)
if (LiveRegs[i])
Kill(i);
delete[] LiveRegs;
}
LiveOuts.clear();
Avail.clear();
Allocator.DestroyAll();