This is an archive of the discontinued LLVM Phabricator instance.

Add llvm-mipdata tool
AbandonedPublic

Authored by ellis on Jun 10 2021, 6:29 PM.

Details

Reviewers
None
Summary

The llvm-mipdata tool is used to create, merge, and show machine profiles.

Usage:
The compiler provides us with a map file default.mipmap at build time which we need to convert to a profile.

$ llvm-mipdata create -p default.mip default.mipmap

When we run the instrumented binary, it will produce a raw file default.mipraw that we can merge into our profile.

$ llvm-mipdata merge -p default.mip default.mipraw

Then we view the contents of the profile. If we have debug info, we can also view source info from the profile.

$ llvm-mipdata show -p default.mip --debug a.out
_Z3fooi
  Source Info: /home/main.cpp:9
  Call Count: 0
  Block Coverage:
     COLD COLD COLD COLD HOT

_Z3bari
  Source Info: /home/main.cpp:16
  Call Count: 1
  Block Coverage:
     HOT  HOT  COLD HOT  HOT

Diff Detail