R600/SI: fix inserting waits for all defines

Unfortunately the previous fix for inserting waits for unordered
defines wasn't sufficient, cause it's possible that even ordered
defines are only partially used (or not used at all).

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Christian Konig 2013-03-18 11:33:45 +00:00
parent 5111627ac1
commit ae621a2bc9

View File

@ -302,21 +302,8 @@ static void increaseCounters(Counters &Dst, const Counters &Src) {
Dst.Array[i] = std::max(Dst.Array[i], Src.Array[i]);
}
bool SIInsertWaits::unorderedDefines(MachineInstr &MI) {
uint64_t TSFlags = TII->get(MI.getOpcode()).TSFlags;
if (TSFlags & SIInstrFlags::LGKM_CNT)
return true;
if (TSFlags & SIInstrFlags::EXP_CNT)
return ExpInstrTypesSeen == 3;
return false;
}
Counters SIInsertWaits::handleOperands(MachineInstr &MI) {
bool UnorderedDefines = unorderedDefines(MI);
Counters Result = ZeroCounts;
// For each register affected by this
@ -329,8 +316,7 @@ Counters SIInsertWaits::handleOperands(MachineInstr &MI) {
if (Op.isDef()) {
increaseCounters(Result, UsedRegs[j]);
if (UnorderedDefines)
increaseCounters(Result, DefinedRegs[j]);
increaseCounters(Result, DefinedRegs[j]);
}
if (Op.isUse())