Page MenuHomePhabricator

[clang] Remove profile available check for fsplit-machine-functions.
ClosedPublic

Authored by snehasish on Sep 18 2020, 2:13 PM.

Details

Summary

Enforcing a profile available check in the driver does not work with
incremental LTO builds where the LTO backend invocation does not include
the profile flags. At this point the profiles have already been consumed
and the IR contains profile metadata. Instead we always pass through the
-fsplit-machine-functions flag on user request. The pass itself contains
a check to return early if no profile information is available.

Diff Detail

Event Timeline

snehasish created this revision.Sep 18 2020, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2020, 2:13 PM
snehasish requested review of this revision.Sep 18 2020, 2:13 PM
tejohnson accepted this revision.Sep 18 2020, 2:22 PM

lgtm with a couple of minor suggestions

clang/lib/Driver/ToolChains/Clang.cpp
4918–4919

nit, remove braces per coding convention.

clang/test/Driver/fsplit-machine-functions.c
3

Might want to check that we get the option despite not having fprofile-use

This revision is now accepted and ready to land.Sep 18 2020, 2:22 PM
snehasish updated this revision to Diff 292899.Sep 18 2020, 2:28 PM

Drop braces, add a test.

  • Remove braces from single line if.
  • Add a test to make sure that option is passed through even if no profiles provided.
snehasish marked 2 inline comments as done.Sep 18 2020, 2:29 PM

Thanks for the quick review!

snehasish retitled this revision from [clang] Remove profile availabile check for fsplit-machine-functions. to [clang] Remove profile available check for fsplit-machine-functions..Sep 18 2020, 2:33 PM