Skip to content

Commit

Permalink
Added intf graph printer
Browse files Browse the repository at this point in the history
  • Loading branch information
9Tempest committed Dec 4, 2023
1 parent e4690c6 commit cc2b44f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gematria/datasets/bhive_importer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,21 @@ absl::StatusOr<BasicBlockWithThroughputProto> BHiveImporter::ParseMIRCsvLine(
return proto;
}

static void prettyPrintFunctionLiveIntervalInfo(const BHiveImporter::FunctionLiveIntervalInfo& info){
for (auto& [name, rangeList] : info.register_name_to_operands){
LOG("Register name: " << name);
for (auto& [start, end] : rangeList){
LOG("Start: " << *start << " End: " << *end);
}
}
}
static void prettyPrintFuncToLiveOntervals(const llvm::DenseMap<llvm::StringRef, BHiveImporter::FunctionLiveIntervalInfo>& func_to_live_intervals_){
for (auto& [name, info] : func_to_live_intervals_){
LOG("Function name: " << name);
prettyPrintFunctionLiveIntervalInfo(info);
}
}

absl::StatusOr<bool> BHiveImporter::LoadMIRModule(std::string_view file_name){
// clear previous loaded module
name_to_mbb_.clear();
Expand Down Expand Up @@ -299,6 +314,7 @@ absl::StatusOr<bool> BHiveImporter::LoadMIRModule(std::string_view file_name){
}
}

prettyPrintFuncToLiveOntervals(func_to_live_intervals_);
return true;
}

Expand Down

0 comments on commit cc2b44f

Please sign in to comment.