[llvm-dev] [RFC][ThinLTO] llvm-dis ThinLTO summary dump format

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 2 12:12:20 PDT 2017


On Fri, Jun 2, 2017 at 8:46 AM, Charles Saternos via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hey all,
>
> Below is the proposed format for the dump of the ThinLTO module summary in
> the llvm-dis utility:
>

The first observation I have is that this should be possibly be behind
a flag. While dumping IR summaries is useful, they may get relatively
big and sometimes people just want to look at the IR.

>> ../build/bin/llvm-dis t.o && cat t.o.ll
> ; ModuleID = '2.o'
> source_filename = "2.ll"
> target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
> target triple = "x86_64-unknown-linux-gnu"
>
> @X = constant i32 42, section "foo", align 4
>
> @a = weak alias i32, i32* @X
>
> define void @afun() {
>   %1 = load i32, i32* @a
>   ret void
> }
>
> define void @testtest() {
>   tail call void @boop()
>   ret void
> }
>
> declare void @boop()
>
> ; Module summary:
> ;  testtest (External linkage)
> ;    Function (2 instructions)
> ;    Calls: boop
> ;  X (External linkage)
> ;    Global Variable
> ;  afun (External linkage)
> ;    Function (2 instructions)
> ;    Refs:
> ;      a
> ;  a (Weak any linkage)

Do you need to dump the linkage for globals? You should be able to
just look at the global in the IR and get it (or, after looking at the
global, run `llvm-nm` on it). I think it's convenient, anyway having
that here, so if Teresa/others think it's fine, we might just keep it.


> ;    Alias (aliasee X)
>
> I've implemented the above format in the llvm-dis utility, since there
> currently isn't really a way of getting ThinLTO summaries in a
> human-readable format.
>
> Let me know what you think of this format, and what information you think
> should be added/removed.
>
> Thanks,
> Charles
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-dev mailing list