diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-11-07 23:08:21 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-11-07 23:08:21 +0000 |
commit | a70e9417fb72407ad458b18c3eeaae77ca079611 (patch) | |
tree | db72e20262b46ad923ff875266496cd7f70c48b8 /llvm/lib/CodeGen/ExecutionDepsFix.cpp | |
parent | 7a4be01ac819f76f6a051efb4a6f96853bffebc3 (diff) | |
download | bcm5719-llvm-a70e9417fb72407ad458b18c3eeaae77ca079611.tar.gz bcm5719-llvm-a70e9417fb72407ad458b18c3eeaae77ca079611.zip |
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.
llvm-svn: 144037
Diffstat (limited to 'llvm/lib/CodeGen/ExecutionDepsFix.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExecutionDepsFix.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/ExecutionDepsFix.cpp b/llvm/lib/CodeGen/ExecutionDepsFix.cpp index 3d6f256dd8e..bd77f655c14 100644 --- a/llvm/lib/CodeGen/ExecutionDepsFix.cpp +++ b/llvm/lib/CodeGen/ExecutionDepsFix.cpp @@ -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(); |