https://github.com/svkeerthy updated 
https://github.com/llvm/llvm-project/pull/153089

>From cbc8c9e34ea28f96e9a01eba5b7a6ce1c2345e2e Mon Sep 17 00:00:00 2001
From: svkeerthy <venkatakeer...@google.com>
Date: Mon, 11 Aug 2025 21:34:27 +0000
Subject: [PATCH] Merging IR2Vec Categories

---
 llvm/include/llvm/Analysis/IR2Vec.h    |  1 +
 llvm/lib/Analysis/IR2Vec.cpp           |  2 +-
 llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp | 12 +++++-------
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/llvm/include/llvm/Analysis/IR2Vec.h 
b/llvm/include/llvm/Analysis/IR2Vec.h
index 15221c7f07917..caa816e2fd76d 100644
--- a/llvm/include/llvm/Analysis/IR2Vec.h
+++ b/llvm/include/llvm/Analysis/IR2Vec.h
@@ -63,6 +63,7 @@ enum class IR2VecKind { Symbolic, FlowAware };
 
 namespace ir2vec {
 
+extern llvm::cl::OptionCategory IR2VecCategory;
 LLVM_ABI extern cl::opt<float> OpcWeight;
 LLVM_ABI extern cl::opt<float> TypeWeight;
 LLVM_ABI extern cl::opt<float> ArgWeight;
diff --git a/llvm/lib/Analysis/IR2Vec.cpp b/llvm/lib/Analysis/IR2Vec.cpp
index 7d0ad6a69a398..9b50262e3c8c5 100644
--- a/llvm/lib/Analysis/IR2Vec.cpp
+++ b/llvm/lib/Analysis/IR2Vec.cpp
@@ -36,7 +36,7 @@ STATISTIC(VocabMissCounter,
 
 namespace llvm {
 namespace ir2vec {
-static cl::OptionCategory IR2VecCategory("IR2Vec Options");
+cl::OptionCategory IR2VecCategory("IR2Vec Options");
 
 // FIXME: Use a default vocab when not specified
 static cl::opt<std::string>
diff --git a/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp 
b/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp
index 8f8b4e2f2bda8..c065aaeedd395 100644
--- a/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp
+++ b/llvm/tools/llvm-ir2vec/llvm-ir2vec.cpp
@@ -55,8 +55,6 @@
 namespace llvm {
 namespace ir2vec {
 
-static cl::OptionCategory IR2VecToolCategory("IR2Vec Tool Options");
-
 // Subcommands
 static cl::SubCommand
     TripletsSubCmd("triplets", "Generate triplets for vocabulary training");
@@ -72,18 +70,18 @@ static cl::opt<std::string>
     InputFilename(cl::Positional,
                   cl::desc("<input bitcode file or '-' for stdin>"),
                   cl::init("-"), cl::sub(TripletsSubCmd),
-                  cl::sub(EmbeddingsSubCmd), cl::cat(IR2VecToolCategory));
+                  cl::sub(EmbeddingsSubCmd), cl::cat(ir2vec::IR2VecCategory));
 
 static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"),
                                            cl::value_desc("filename"),
                                            cl::init("-"),
-                                           cl::cat(IR2VecToolCategory));
+                                           cl::cat(ir2vec::IR2VecCategory));
 
 // Embedding-specific options
 static cl::opt<std::string>
     FunctionName("function", cl::desc("Process specific function only"),
                  cl::value_desc("name"), cl::Optional, cl::init(""),
-                 cl::sub(EmbeddingsSubCmd), cl::cat(IR2VecToolCategory));
+                 cl::sub(EmbeddingsSubCmd), cl::cat(ir2vec::IR2VecCategory));
 
 enum EmbeddingLevel {
   InstructionLevel, // Generate instruction-level embeddings
@@ -100,7 +98,7 @@ static cl::opt<EmbeddingLevel>
                      clEnumValN(FunctionLevel, "func",
                                 "Generate function-level embeddings")),
           cl::init(FunctionLevel), cl::sub(EmbeddingsSubCmd),
-          cl::cat(IR2VecToolCategory));
+          cl::cat(ir2vec::IR2VecCategory));
 
 namespace {
 
@@ -325,7 +323,7 @@ int main(int argc, char **argv) {
   using namespace llvm::ir2vec;
 
   InitLLVM X(argc, argv);
-  cl::HideUnrelatedOptions(IR2VecToolCategory);
+  cl::HideUnrelatedOptions(ir2vec::IR2VecCategory);
   cl::ParseCommandLineOptions(
       argc, argv,
       "IR2Vec - Embedding Generation Tool\n"

_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to