[PATCH] D149327: [llvm-exegesis] Create snippet object files with predictable names

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 00:53:24 PDT 2023


courbet added inline comments.


================
Comment at: llvm/docs/CommandGuide/llvm-exegesis.rst:362-364
+ If set, llvm-exegesis will dump the generated code to file. If multiple files
+ are to be written, they will have names /path/to/file-OPCODE-REPETITOR.o with
+ `-OPCODE` and `-REPETITOR` parts omitted if always the same.
----------------
Why not always add the `OPCODE` and `REPETITOR` parts ? Consistency is good :)


================
Comment at: llvm/tools/llvm-exegesis/lib/FileNameGenerator.cpp:27-41
+  size_t DotPosition = FileName.rfind('.');
+  size_t SlashPosition = FileName.find_last_of("/\\");
+
+  if (DotPosition == StringRef::npos ||
+      (SlashPosition != StringRef::npos && DotPosition < SlashPosition)) {
+    // Two corner cases:
+    // 1) "/path/to/file" - no dots at all
----------------
Don't roll your own code for this - use `llvm/include/llvm/Support/Path.h`.


================
Comment at: llvm/tools/llvm-exegesis/llvm-exegesis.cpp:365
+  // It is likely to have only a single configuration per opcode, so handle
+  // Index == 0 differently and return just "OPC" instead of "OPC-0".
+  if (Key.Index == 0)
----------------
Let's remove the special case and be consistent


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149327/new/

https://reviews.llvm.org/D149327



More information about the llvm-commits mailing list