[llvm] [llvm-remarkutil] Add an instruction-mix tool (PR #140598)

Tobias Stadler via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 07:57:24 PDT 2025


================
@@ -0,0 +1,125 @@
+
+#include "RemarkUtilHelpers.h"
+#include "RemarkUtilRegistry.h"
+
+#include "llvm/Support/Format.h"
+#include "llvm/Support/FormattedStream.h"
+#include "llvm/Support/Regex.h"
+
+#include <numeric>
+
+using namespace llvm;
+using namespace remarks;
+using namespace llvm::remarkutil;
+
+namespace instructionmix {
+
+static cl::SubCommand
+    InstructionMix("instruction-mix",
+                   "Instruction Mix (requires asm-printer remarks)");
+
+static cl::opt<std::string>
+    FunctionFilter("filter", cl::sub(InstructionMix), cl::init(".*"),
+                   cl::value_desc("filter_regex"),
+                   cl::desc("regex to filter functions with"));
+
+enum ReportStyleOptions { human_output, csv_output };
+static cl::opt<ReportStyleOptions> ReportStyle(
+    "report_style", cl::sub(InstructionMix),
+    cl::init(ReportStyleOptions::human_output),
+    cl::desc("Choose the report output format:"),
+    cl::values(clEnumValN(human_output, "human", "Human-readable format"),
+               clEnumValN(csv_output, "csv", "CSV format")));
+
+INPUT_FORMAT_COMMAND_LINE_OPTIONS(InstructionMix)
+INPUT_OUTPUT_COMMAND_LINE_OPTIONS(InstructionMix)
+DEBUG_LOC_INFO_COMMAND_LINE_OPTIONS(InstructionMix)
----------------
tobias-stadler wrote:

Can this be removed since we don't use the UseDebugLoc option here?

https://github.com/llvm/llvm-project/pull/140598


More information about the llvm-commits mailing list