Page MenuHomePhabricator

Add llvm-mipdata tool
Needs ReviewPublic

Authored by ellis on Jun 10 2021, 6:29 PM.
This revision needs review, but there are no reviewers specified.

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

Unit TestsFailed

TimeTest
20 msx64 debian > LLVM.tools/llvm-mipdata::function-coverage.test
Script: -- : 'RUN: at line 1'; xxd -r /var/lib/buildkite-agent/builds/llvm-project/llvm/test/tools/llvm-mipdata/Inputs/function-coverage.mipmap.hex > /var/lib/buildkite-agent/builds/llvm-project/build/test/tools/llvm-mipdata/Output/function-coverage.test.tmp.mipmap
20 msx64 windows > flang-Unit.RuntimeGTest/_/FlangRuntimeTests_exe::TimeIntrinsics.CpuTime
Script: -- C:\ws\w4\llvm-project\premerge-checks\build\tools\flang\unittests\RuntimeGTest\.\FlangRuntimeTests.exe --gtest_filter=TimeIntrinsics.CpuTime