[PATCH] D117244: [llvm-dis] Add an option `print-thinlto-index-only` in llvm-dis to read ThinLTO minimized code only.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 19 13:43:40 PST 2022


tejohnson added inline comments.


================
Comment at: llvm/test/Bitcode/thinlto-index-disassembled-by-llvm-dis.ll:15
+; RUN: llvm-dis --print-thinlto-index-only %t.thinlink.bc -o - | FileCheck %s --check-prefix=DIS
+; DIS: ^0 = module: (path: "{{.*}}thinlto-index-disassembled-by-llvm-dis.ll.tmp.thinlink.bc", hash:
+; DIS: ^1 = gv: (name: "aplusb", summaries: (function: (module: ^0, flags: (linkage: external, visibility: default, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 2))) ; guid = 
----------------
If you change the suffix part to a wildcard then I believe the same checking lines could be shared by both llvm-dis invocations (e.g. remove FULL below and use DIS). Or just stop matching after thinlto-index-disassembled-by-llvm-dis.ll.tmp instead of using a wildcard.


================
Comment at: llvm/tools/llvm-dis/llvm-dis.cpp:79
+    "dump-thinlto-index-only",
+    cl::desc("Only read thinlto index and dump the index as a bitcode file."),
+    cl::init(false), cl::Hidden, cl::cat(DisCategory));
----------------
tejohnson wrote:
> "dump the index as a bitcode file" Do you mean dump/print the LLVM assembly? Suggest replacing "dump" with "print" in the option also.
I would remove "as a bitcode file" since we aren't printing as bitcode (bitcode is the encoded input format),  or use my initial suggestion to replace this with "LLVM assembly".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117244



More information about the llvm-commits mailing list