Skip to content

Commit

Permalink
Add none annotator type (llvm#67)
Browse files Browse the repository at this point in the history
This patch adds a none annotator type to
convert_bhive_to_llvm_exegesis_input that doesn't run any annotator.
This is useful for looking at the output assembly for debugging
purposes.
  • Loading branch information
boomanaiden154 authored Mar 11, 2024
1 parent 63f4a18 commit 78f6845
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gematria/datasets/convert_bhive_to_llvm_exegesis_input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ constexpr std::string_view kMemDefPrefix = "# LLVM-EXEGESIS-MEM-DEF ";
constexpr std::string_view kMemMapPrefix = "# LLVM-EXEGESIS-MEM-MAP ";
constexpr std::string_view kMemNamePrefix = "MEM";

enum class AnnotatorType { kExegesis, kFast };
enum class AnnotatorType { kExegesis, kFast, kNone };

constexpr std::pair<AnnotatorType, std::string_view> kAnnotatorTypeNames[] = {
{AnnotatorType::kExegesis, "exegesis"}, {AnnotatorType::kFast, "fast"}};
{AnnotatorType::kExegesis, "exegesis"},
{AnnotatorType::kFast, "fast"},
{AnnotatorType::kNone, "none"}};

bool AbslParseFlag(absl::string_view text, AnnotatorType* type,
std::string* error) {
Expand Down Expand Up @@ -104,6 +106,8 @@ absl::StatusOr<gematria::AccessedAddrs> GetAccessedAddrs(
return gematria::LlvmExpectedToStatusOr(
exegesis_annotator->findAccessedAddrs(
llvm::ArrayRef(basic_block.begin(), basic_block.end())));
case AnnotatorType::kNone:
return gematria::AccessedAddrs();
}
return absl::InvalidArgumentError("unknown annotator type");
}
Expand Down

0 comments on commit 78f6845

Please sign in to comment.