Skip to content

Commit ce679af

Browse files
wpangfxbot
authored andcommitted
Multiple pseudo-kill instructions may be mapped to a single
intruction. during relocation. Change-Id: I8f583c66cfafd2ae5c6b10509268494007e1c0d6
1 parent eff75b3 commit ce679af

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

visa/LocalScheduler/G4_Sched.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,13 +1466,16 @@ static G4_INST* minElt(const std::vector<preEdge>& Elts)
14661466
void BB_Scheduler::relocatePseudoKills()
14671467
{
14681468
// Reset local id after scheduling and build the location map.
1469-
std::unordered_map<G4_INST*, G4_INST*> LocMap;
1469+
// Multiple pseudo-kills may be placed before a single instruction.
1470+
std::unordered_map<G4_INST*, std::vector<G4_INST *>> LocMap;
14701471
int i = 0;
14711472
for (auto Inst : schedule) { Inst->setLocalId(i++); }
14721473
for (auto N : ddd.getNodes()) {
14731474
G4_INST* Inst = N->getInst();
1474-
if (Inst && Inst->isPseudoKill())
1475-
LocMap[minElt(N->Succs)] = Inst;
1475+
if (Inst && Inst->isPseudoKill()) {
1476+
G4_INST* Pos = minElt(N->Succs);
1477+
LocMap[Pos].push_back(Inst);
1478+
}
14761479
}
14771480

14781481
// Do nothing if there is no pseudo-kills.
@@ -1488,7 +1491,7 @@ void BB_Scheduler::relocatePseudoKills()
14881491
continue;
14891492
auto I = LocMap.find(Inst);
14901493
if (I != LocMap.end())
1491-
relocated.push_back(I->second);
1494+
relocated.insert(relocated.end(), I->second.begin(), I->second.end());
14921495
relocated.push_back(Inst);
14931496
}
14941497
std::swap(schedule, relocated);
@@ -1557,7 +1560,7 @@ bool BB_Scheduler::commitIfBeneficial(unsigned& MaxRPE, bool IsTopDown)
15571560
return true;
15581561
}
15591562
} else if (NewRPE < MaxRPE) {
1560-
SCHED_DUMP(std::cerr << "the reduced pressure is " << NewRPE - MaxRPE << "\n");
1563+
SCHED_DUMP(std::cerr << "the reduced pressure is " << MaxRPE - NewRPE << "\n");
15611564
}
15621565
}
15631566

0 commit comments

Comments
 (0)