[PATCH] D107536: [BitcodeAnalyzer] allow a motivated user to dump BLOCKINFO

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 9 14:02:02 PDT 2021


tejohnson added inline comments.


================
Comment at: llvm/test/tools/llvm-bcanalyzer/dump-blockinfo.test:1
+# RUN: llvm-stress | llvm-as - | llvm-bcanalyzer --dump --dump-blockinfo | FileCheck %s
+
----------------
woodruffw wrote:
> mehdi_amini wrote:
> > tejohnson wrote:
> > > woodruffw wrote:
> > > > N.B.: Please let me know if using `llvm-stress` like this isn't advisable; I can check in a test input instead if that's preferred.
> > > Can you make this a small .ll test instead (see examples in other test directories) and just run it through opt to get a bitcode and then run llvm-bcanalyzer on that?
> > > 
> > > And then is it possible to check some of the expected contents of the blockinfo section?
> > What Theresa suggests makes sense to me.
> Done!
Generally we avoid using bitcode directly as a test input, because the format can change. What I would suggest is to llvm-dis that bitcode into a .ll file. Then just make that the test file with the command and tests in it. I.e. rather than a .test extension like this, have something like a llvm/test/tools/llvm-bcanalyzer/dump-blockinfo.ll test that contains your llvm-dis'ed bitcode file, then add commands in it like:

; RUN: llvm-as < %s | llvm-bcanalyzer --dump --dump-blockinfo | FileCheck %s

; CHECK: ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107536



More information about the llvm-commits mailing list