Commit Graph

15 Commits

Author SHA1 Message Date
Rong Xu 50da55a585 [PGO] Supporting code for always instrumenting entry block
This patch includes the supporting code that enables always
instrumenting the function entry block by default.

This patch will NOT the default behavior.

It adds a variant bit in the profile version, adds new directives in
text profile format, and changes llvm-profdata tool accordingly.

This patch is a split of D83024 (https://reviews.llvm.org/D83024)
Many test changes from D83024 are also included.

Differential Revision: https://reviews.llvm.org/D84261
2020-07-22 15:01:53 -07:00
Reid Kleckner 63bb6737ce Update clang tests for new LLVM IR backslash printing in r374415
llvm-svn: 374416
2019-10-10 18:36:41 +00:00
Rong Xu 206fe82be4 [PGO] Fix bolt failures from r367628
Relaxed the check in a test because the windows bolt generates different
profile variables.

llvm-svn: 367657
2019-08-02 07:21:50 +00:00
Rong Xu ca161fa008 [PGO] Add PGO support at -O0 in the experimental new pass manager
Add PGO support at -O0 in the experimental new pass manager to sync the
behavior of the legacy pass manager.

Also change the test of gcc-flag-compatibility.c for more complete test:
(1) change the match string to "profc" and "profd" to ensure the
    instrumentation is happening.
(2) add IR format proftext so that PGO use compilation is tested.

Differential Revision: https://reviews.llvm.org/D64029

llvm-svn: 367628
2019-08-01 22:36:34 +00:00
Leonard Chan da47e2cac3 Revert "[clang][NewPM] Fix broken profile test"
This reverts commit ab2c0ed01e.

See https://reviews.llvm.org/D63155

llvm-svn: 364692
2019-06-29 00:10:22 +00:00
Leonard Chan ab2c0ed01e [clang][NewPM] Fix broken profile test
This contains the part of D62225 which fixes Profile/gcc-flag-compatibility.c
by adding the pass that allows default profile generation to work under the new
PM. It seems that ./default.profraw was not being generated with new PM enabled.

Differential Revision: https://reviews.llvm.org/D63155

llvm-svn: 363278
2019-06-13 17:25:36 +00:00
Chandler Carruth 9d25111a4a Fix two test cases I missed updating in r291850. Sorry for the noise.
llvm-svn: 291853
2017-01-12 22:48:28 +00:00
Chandler Carruth 93786da2cb Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.
Much to my surprise, '-disable-llvm-optzns' which I thought was the
magical flag I wanted to get at the raw LLVM IR coming out of Clang
deosn't do that. It still runs some passes over the IR. I don't want
that, I really want the *raw* IR coming out of Clang and I strongly
suspect everyone else using it is in the same camp.

There is actually a flag that does what I want that I didn't know about
called '-disable-llvm-passes'. I suspect many others don't know about it
either. It both does what I want and is much simpler.

This removes the confusing version and makes that spelling of the flag
an alias for '-disable-llvm-passes'. I've also moved everything in Clang
to use the 'passes' spelling as it seems both more accurate (*all* LLVM
passes are disabled, not just optimizations) and much easier to remember
and spell correctly.

This is part of simplifying how Clang drives LLVM to make it cleaner to
wire up to the new pass manager.

Differential Revision: https://reviews.llvm.org/D28047

llvm-svn: 290392
2016-12-23 00:23:01 +00:00
Xinliang David Li b7b335a2ce [Profile] Enable profile merging with -fprofile-generat[=<dir>]
This patch enables raw profile merging for this option which is the
new intended behavior.

llvm-svn: 276484
2016-07-22 22:25:01 +00:00
Xinliang David Li 9081de2e32 [profile] update test case with interface change.
See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614

llvm-svn: 276356
2016-07-21 23:19:39 +00:00
Sean Silva a834ff260a [Driver] Add flags for enabling both types of PGO Instrumentation
The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

Differential Revision: https://reviews.llvm.org/D21823

llvm-svn: 275668
2016-07-16 02:54:58 +00:00
Xinliang David Li d796887961 Fix a soon to be invalid test
Remove a check that won't be valid when LLVM stops
emitting runtime hook user function.

llvm-svn: 251611
2015-10-29 04:04:07 +00:00
NAKAMURA Takumi ddb44b85f0 Tweak a couple of -fprofile tests in clang/test to accept backslash in path.
llvm-svn: 241903
2015-07-10 13:11:08 +00:00
Daniel Jasper 7dc6b50047 Remove test that tests referring to the current working directory. You
cannot assume that the current working directory is writable in all test
environments. I don't know a better way to write this test of hand, lets
discuss. Possibly, a better option would be to put these together with
other test testing the driver directly.

llvm-svn: 241885
2015-07-10 05:57:23 +00:00
Diego Novillo 578caf5da7 Add GCC-compatible flags -fprofile-generate and -fprofile-use.
This patch adds support for specifying where the profile is emitted in a
way similar to GCC. These flags are used to specify directories instead
of filenames. When -fprofile-generate=DIR is used, the compiler will
generate code to write to <DIR>/default.profraw.

The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be
used to override the directory and file name to use and -fprofile-use
accepts both directories and filenames.

To simplify the set of flags used in the backend, all the flags get
canonicalized to -fprofile-instr-{generate,use} when passed to the
backend. The decision to use a default name for the profile is done
in the driver.

llvm-svn: 241825
2015-07-09 17:23:53 +00:00