Page MenuHomePhabricator

Add clang frontend flags for MIP
Needs ReviewPublic

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

Details

Summary

Add clang frontend flags for machine profiles.

  • -fmachine-profile-generate
    • Produce an instrumented binary
  • -fmachine-profile-function-coverage
    • Only profile function coverage
  • -fmachine-profile-block-coverage
    • Profile basic block coverage
  • -fmachine-profile-link-unit-name=
    • Specify a name to identify the current link unit
  • -fno-machine-profile-runtime
    • Do not link the MIP runtime
  • -fno-machine-profile-dump
    • Do not dump the raw profile data when the program exits
  • -fmachine-profile-selected-function-group=, -fmachine-profile-function-group-count=
    • Only instrument group i of N total groups of functions
  • -fmachine-profile-use=
    • Use the provided profile for optimization

Diff Detail

Unit TestsFailed

TimeTest
50 msx64 debian > LLVM.CodeGen/AArch64::mip-comdat.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/mip-comdat.ll -enable-machine-instrumentation -enable-machine-function-coverage -mtriple=arm64-linux | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/mip-comdat.ll
50 msx64 debian > LLVM.CodeGen/AArch64::mip-map.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/mip-map.ll -enable-machine-instrumentation -enable-machine-function-coverage -enable-machine-block-coverage -mtriple=arm64-linux | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/mip-map.ll --check-prefixes CHECK,CHECK-ELF
50 msx64 debian > LLVM.CodeGen/ARM::mip-comdat.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/ARM/mip-comdat.ll -enable-machine-instrumentation -enable-machine-function-coverage -mtriple=armv7-linux | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/ARM/mip-comdat.ll
90 msx64 debian > LLVM.CodeGen/ARM::mip-map.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/ARM/mip-map.ll -enable-machine-instrumentation -enable-machine-function-coverage -mtriple=armv7-linux | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/ARM/mip-map.ll
80 msx64 debian > LLVM.CodeGen/X86::mip-comdat.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/X86/mip-comdat.ll -enable-machine-instrumentation -enable-machine-function-coverage -mtriple=x86_64-linux | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/X86/mip-comdat.ll
View Full Test Results (14 Failed)

Event Timeline

ellis created this revision.Jun 10 2021, 6:29 PM
ellis requested review of this revision.Jun 10 2021, 6:29 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 10 2021, 6:29 PM
jhenderson added inline comments.Jun 11 2021, 12:12 AM
llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
59 ↗(On Diff #351326)

This doesn't look like it belongs as part of this commit?

ellis updated this revision to Diff 351604.Jun 11 2021, 5:30 PM

Move llvm-strip logic into its own commit

ellis updated this revision to Diff 352007.Jun 14 2021, 3:20 PM

MIP does not support windows

jhenderson resigned from this revision.Jun 14 2021, 11:50 PM
ellis updated this revision to Diff 353705.Jun 22 2021, 10:37 AM

Correctly link the runtime symbol for Mach-O.

ellis updated this revision to Diff 355066.Jun 28 2021, 4:31 PM

Add min instruction count frontend flag.