Commit Graph

102 Commits

Author SHA1 Message Date
Vedant Kumar 54e06823d2 [profiling] Make a test more explicit. NFC.
The cxx-structors.cpp test checks that some instrumentation doesn't
appear, but it should be more explicit about which instrumentation it
actually expects to appear.

llvm-svn: 295532
2017-02-18 02:02:55 +00:00
Vedant Kumar a32c08d304 [profiling] Tighten test cases which refer to "profn" vars. NFC.
The frontend can't see "__profn" profile name variables after IRGen
because llvm throws these away now. Tighten up some test cases which
checked for the non-existence of those variables.

llvm-svn: 295528
2017-02-18 01:50:14 +00:00
Vedant Kumar 9503004089 [profiling] Update test cases to deal with name variable change (NFC)
This is a re-try of r295085: fix up some test cases that assume that
profile name variables are preserved by the instrprof pass.

This catches one additional case in test/CoverageMapping/unused_names.c.

llvm-svn: 295101
2017-02-14 20:03:56 +00:00
Vedant Kumar 0e052d89bd Revert "[profiling] Update test case to deal with name variable change (NFC)"
This reverts commit r295085, because the corresponding llvm change was
reverted.

llvm-svn: 295100
2017-02-14 20:03:53 +00:00
Vedant Kumar 4b5315f8ac [profiling] Update test case to deal with name variable change (NFC)
The 'profn' name variables shouldn't show up after we run the instrprof
pass, see https://reviews.llvm.org/D29921 for more details.

llvm-svn: 295085
2017-02-14 18:49:03 +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
Marcin Koscielnicki 069dd06592 Add test for D21736.
Differential Revision: http://reviews.llvm.org/D21741

llvm-svn: 287689
2016-11-22 20:03:40 +00:00
Vedant Kumar 9d2a16b9b1 [Coverage] Support for C++17 if initializers
Differential Revision: https://reviews.llvm.org/D25572

llvm-svn: 284293
2016-10-14 23:38:16 +00:00
Vedant Kumar f2a6ec5521 [Coverage] Support for C++17 switch initializers
Differential Revision: https://reviews.llvm.org/D25539

llvm-svn: 284292
2016-10-14 23:38:13 +00:00
Vedant Kumar f1ccf72d38 [Profile] Update testcase for r283948 (NFC)
Old: "__DATA,__llvm_prf_data"
New: "__DATA,__llvm_prf_data,regular,live_support"

This should fix the following bot failure:

  http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55158

llvm-svn: 283949
2016-10-11 21:56:05 +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
Easwaran Raman 351acd7147 Remove MaxFunctionCount module flag annotation.
Differential revision: http://reviews.llvm.org/D19184

llvm-svn: 273198
2016-06-20 20:48:32 +00:00
Sean Silva 70e2766fb4 [profile] Fix another use of the driver.
Follow-on to r267262.

llvm-svn: 267263
2016-04-23 02:13:48 +00:00
Sean Silva 1e51ac29b1 [profile] Use cc1 in these tests instead of the driver.
I ran into this when seeing what tests would break if we make a
driver-level decision about whether FEPGO or IRPGO is the default.

llvm-svn: 267262
2016-04-23 02:11:16 +00:00
Betul Buyukkurt 3da993c419 [PGO] Avoid instrumenting constants at value sites
Value profiling should not profile constants and/or constant
expressions when they appear as callees in call instructions.
Constant expressions form when a direct callee has bitcasts or
inttoptr(ptrtint (callee)) nests surrounding it. Value profiling
should avoid instrumenting such cases. Mostly NFC.

llvm-svn: 265037
2016-03-31 18:41:34 +00:00
Betul Buyukkurt d68bbdcc12 [PGO] Test case fix for r264783
llvm-svn: 264795
2016-03-29 22:17:52 +00:00
Betul Buyukkurt cb6f5f16e6 [PGO] Move the instrumentation point closer to the value site.
For terminator instructions, the value profiling instrumentation
happens in a basic block other than where the value site resides.
This CR moves the instrumentation point prior to the value site.
Mostly NFC.

llvm-svn: 264783
2016-03-29 20:44:09 +00:00
Easwaran Raman 8160812e26 Attach profile summary information to Module.
Differential Revision: http://reviews.llvm.org/D18289

llvm-svn: 264342
2016-03-24 21:32:25 +00:00
Rong Xu 9c6f1538cc [PGO] Change profile use cc1 option to handle IR level profiles
This patch changes cc1 option for PGO profile use from
-fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>.
-fprofile-instr-use=<path> is now a driver only option.

In addition to decouple the cc1 option from the driver level option, this patch
also enables IR level profile use. cc1 option handling now reads the profile
header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM}
-- this is a common enum for -fprofile-instrument={}, for the profile
instrumentation), and invoke the pipeline to enable the respective PGO use pass.

Reviewers: silvas, davidxl

Differential Revision: http://reviews.llvm.org/D17737

llvm-svn: 262515
2016-03-02 20:59:36 +00:00
Xinliang David Li 13cf09dc38 Test simplification
llvm-svn: 261047
2016-02-17 00:59:01 +00:00
Xinliang David Li a951e8ece7 [PGO] Fix issue: explicitly defaulted assignop is not profiled
Differential Revision: http://reviews.llvm.org/D16947
 

llvm-svn: 260270
2016-02-09 20:02:59 +00:00
Xinliang David Li 55adc9ddcc [PGO] Cover more cases of implicitly generated C++ methods
llvm-svn: 260161
2016-02-08 22:41:37 +00:00
Xinliang David Li 64581393cf Simplify test cases
llvm-svn: 260126
2016-02-08 19:14:14 +00:00
Xinliang David Li 6962659a36 Fix test case problem(caused by clang-format
llvm-svn: 260022
2016-02-07 07:13:18 +00:00
Xinliang David Li 4e1aa2de76 [PGO] add profile/coverage test cases for defaulted ctor/ctors
llvm-svn: 260021
2016-02-07 06:57:29 +00:00
Rong Xu 9837ef56b4 [PGO] cc1 option name change for profile instrumentation
This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.

Review: http://reviews.llvm.org/D16730
llvm-svn: 259811
2016-02-04 18:39:09 +00:00
Xinliang David Li 3106d9a122 [PGO] test case cleanups
1. Make test case more focused and robust by focusing on what to be tested (linkage, icall) -- make it easier to validate
2. Testing linkages of data and counter variables instead of names. Counters and data are more relavant to be tested.

llvm-svn: 259067
2016-01-28 18:25:53 +00:00
Betul Buyukkurt 518276a5fe Clang changes for value profiling
Differential Revision: http://reviews.llvm.org/D8940

llvm-svn: 258650
2016-01-23 22:50:44 +00:00
Easwaran Raman eed30e5a81 Remove setting of inlinehint and cold attributes based on profile data
NFC. These hints are only used for inlining and the inliner now uses
the same criteria to identify hot and cold callees and set appropriate
thresholds without relying on these hints. Hence this removed code is
superfluous.

Differential Revision: http://reviews.llvm.org/D15726

llvm-svn: 256793
2016-01-04 23:32:28 +00:00
Easwaran Raman 695890c971 Attach maximum function count to Module when using PGO mode.
This sets the maximum entry count among all functions in the program to the module using module flags. This allows the optimizer to use this information.

Differential Revision: http://reviews.llvm.org/D15163

llvm-svn: 255918
2015-12-17 19:14:27 +00:00
Xinliang David Li ddbdb1e0be [PGO] make profile prefix even shorter and more readable
llvm-svn: 255587
2015-12-15 00:33:12 +00:00
Xinliang David Li 8608513b69 [PGO] Shorten profile symbol prefixes
(test case update)
Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.

Differential Revision: http://reviews.llvm.org/D15503

llvm-svn: 255576
2015-12-14 23:26:46 +00:00
Xinliang David Li 13ec697056 Revert r255445: adding a new test case
llvm-svn: 255447
2015-12-13 04:45:49 +00:00
Xinliang David Li c79d69ddd7 Resubmit new test case after adding more constraint
llvm-svn: 255445
2015-12-13 03:03:35 +00:00
Xinliang David Li e82c58588d Revert 255436 : remove test that needs to be refined
llvm-svn: 255437
2015-12-12 18:49:37 +00:00
Xinliang David Li c8788d2a97 [PGO] add a test case with -no-integrated-as
llvm-svn: 255436
2015-12-12 17:39:38 +00:00
Xinliang David Li aab1fd16bc [PGO] Stop using invalid char in instr variable names.
(This is part-2 of the patch of r255434 -- 
fixing test cases, second try)

llvm-svn: 255435
2015-12-12 17:28:37 +00:00
Xinliang David Li e1769ef559 [PGO] Revert r255366: solution incomplete, not handling lambda yet
llvm-svn: 255368
2015-12-11 20:23:12 +00:00
Xinliang David Li 871daea550 [PGO] Stop using invalid char in instr variable names.
(This is part-2 of the patch -- fixing test cases)

Before the patch, -fprofile-instr-generate compile will fail
if no integrated-as is specified when the file contains
any static functions (the -S output is also invalid).

This patch fixed the issue. With the change, the index format
version will be bumped up by 1. Backward compatibility is 
preserved with this change.

Differential Revision: http://reviews.llvm.org/D15243

llvm-svn: 255366
2015-12-11 19:53:35 +00:00
Xinliang David Li 9c586b6c8f [PGO] Add a test case to cover version-3 format
llvm-svn: 255326
2015-12-11 04:02:57 +00:00
Serge Pavlov 3a5614599a [PGO] Instrument only base constructors and destructors.
Constructors and destructors may be represented by several functions
in IR. Only base structors correspond to source code, others are
small pieces of code and eventually call the base variant. In this
case instrumentation of non-base structors has little sense, this
fix remove it. Now profile data of a declaration corresponds to
exactly one function in IR, it agrees with the current logic of the
profile data loading.

This change fixes PR24996.

Differential Revision: http://reviews.llvm.org/D15158

llvm-svn: 254876
2015-12-06 14:32:39 +00:00
Betul Buyukkurt 6247bed9bd [PGO] Test update for revision 253484.
llvm-svn: 253485
2015-11-18 18:15:55 +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
NAKAMURA Takumi 886fbad410 Fix a couple of tests in clang/test to match "x86_thiscallcc" introduced in r240971.
llvm-svn: 241047
2015-06-30 08:02:26 +00:00