Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
Show First 20 Lines • Show All 1,161 Lines • ▼ Show 20 Lines | #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) | ||||
dumpNodeName(SU); | dumpNodeName(SU); | ||||
dbgs() << ": "; | dbgs() << ": "; | ||||
SU.getInstr()->dump(); | SU.getInstr()->dump(); | ||||
#endif | #endif | ||||
} | } | ||||
void ScheduleDAGInstrs::dump() const { | void ScheduleDAGInstrs::dump() const { | ||||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) | #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) | ||||
if (EntrySU.getInstr() != nullptr) | |||||
dumpNodeAll(EntrySU); | |||||
for (const SUnit &SU : SUnits) | for (const SUnit &SU : SUnits) | ||||
dumpNodeAll(SU); | dumpNodeAll(SU); | ||||
if (ExitSU.getInstr() != nullptr) | if (ExitSU.getInstr() != nullptr) | ||||
dumpNodeAll(ExitSU); | dumpNodeAll(ExitSU); | ||||
#endif | #endif | ||||
} | } | ||||
std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const { | std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const { | ||||
std::string s; | std::string s; | ||||
raw_string_ostream oss(s); | raw_string_ostream oss(s); | ||||
if (SU == &EntrySU) | if (SU == &ExitSU) | ||||
oss << "<entry>"; | |||||
else if (SU == &ExitSU) | |||||
oss << "<exit>"; | oss << "<exit>"; | ||||
else | else | ||||
SU->getInstr()->print(oss, /*SkipOpers=*/true); | SU->getInstr()->print(oss, /*SkipOpers=*/true); | ||||
return oss.str(); | return oss.str(); | ||||
} | } | ||||
/// Return the basic block label. It is not necessarilly unique because a block | /// Return the basic block label. It is not necessarilly unique because a block | ||||
/// contains multiple scheduling regions. But it is fine for visualization. | /// contains multiple scheduling regions. But it is fine for visualization. | ||||
▲ Show 20 Lines • Show All 334 Lines • Show Last 20 Lines |