Skip to content

Commit 7012c5c

Browse files
committed
Address review comments, thanks!
1 parent ba27ad2 commit 7012c5c

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

llvm/lib/CodeGen/MachinePipeliner.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class LoopCarriedOrderDepsTracker {
334334

335335
private:
336336
/// Tags to \p SU if the instruction may affect the order-dependencies.
337-
std::optional<TaggedSUnit> checkInstrType(SUnit *SU) const;
337+
std::optional<InstrTag> getInstrTag(SUnit *SU) const;
338338

339339
void addLoopCarriedDepenenciesForChunks(const LoadStoreChunk &From,
340340
const LoadStoreChunk &To);
@@ -1030,34 +1030,29 @@ LoopCarriedOrderDepsTracker::LoopCarriedOrderDepsTracker(
10301030
void LoopCarriedOrderDepsTracker::computeDependencies() {
10311031
// Traverse all instructions and extract only what we are targetting.
10321032
for (auto &SU : SUnits) {
1033-
auto Tagged = checkInstrType(&SU);
1033+
auto Tagged = getInstrTag(&SU);
10341034

10351035
// This instruction has no loop-carried order-dependencies.
10361036
if (!Tagged)
10371037
continue;
1038-
TaggedSUnits.push_back(*Tagged);
1038+
TaggedSUnits.emplace_back(&SU, *Tagged);
10391039
}
10401040

10411041
computeDependenciesAux();
1042-
1043-
LLVM_DEBUG({
1044-
for (unsigned I = 0; I != N; I++)
1045-
assert(!LoopCarried[I].test(I) && "Unexpected self-loop");
1046-
});
10471042
}
10481043

1049-
std::optional<LoopCarriedOrderDepsTracker::TaggedSUnit>
1050-
LoopCarriedOrderDepsTracker::checkInstrType(SUnit *SU) const {
1044+
std::optional<LoopCarriedOrderDepsTracker::InstrTag>
1045+
LoopCarriedOrderDepsTracker::getInstrTag(SUnit *SU) const {
10511046
MachineInstr *MI = SU->getInstr();
10521047
if (TII->isGlobalMemoryObject(MI))
1053-
return TaggedSUnit(SU, InstrTag::Barrier);
1048+
return InstrTag::Barrier;
10541049

10551050
if (MI->mayStore() ||
10561051
(MI->mayLoad() && !MI->isDereferenceableInvariantLoad()))
1057-
return TaggedSUnit(SU, InstrTag::LoadOrStore);
1052+
return InstrTag::LoadOrStore;
10581053

10591054
if (MI->mayRaiseFPException())
1060-
return TaggedSUnit(SU, InstrTag::FPExceptions);
1055+
return InstrTag::FPExceptions;
10611056

10621057
return std::nullopt;
10631058
}

0 commit comments

Comments
 (0)