summaryrefslogtreecommitdiffstats
path: root/test/Profile
Commit message (Collapse)AuthorAgeFilesLines
* [Profile] Do not assign counters to functions without bodiesVedant Kumar2017-06-302-0/+30
| | | | | | | | | The root cause of the issues reported in D32406 and D34680 is that clang instruments functions without bodies. Make it stop doing that, and also teach it how to use old (incorrectly generated) profiles without crashing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306883 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo. NFC.Vedant Kumar2017-06-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306882 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Add off-by-default -Wprofile-instr-missing warningVedant Kumar2017-04-271-8/+8
| | | | | | | | | | | | | | | Clang warns that a profile is out-of-date if it can't find a profile record for any function in a TU. This warning became noisy after llvm started allowing dead-stripping of instrumented functions. To fix this, this patch changes the existing profile out-of-date warning (-Wprofile-instr-out-of-date) so that it only complains about mismatched data. Further, it introduces a new, off-by-default warning about missing function data (-Wprofile-instr-missing). Differential Revision: https://reviews.llvm.org/D28867 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301570 91177308-0d34-0410-b5e6-96231b3b80d8
* Weaken test/Profile/c-ternary.cVedant Kumar2017-02-251-1/+1
| | | | | | | | | There is a bot which doesn't use '%1' as the IR name of the first argument to a function: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/2050/steps/test-stage1-compiler/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296248 91177308-0d34-0410-b5e6-96231b3b80d8
* Retry: [profiling] Fix profile counter increment when emitting selects (PR32019)Vedant Kumar2017-02-251-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2nd attempt: the first was in r296231, but it had a use after lifetime bug. Clang has logic to lower certain conditional expressions directly into llvm select instructions. However, it does not emit the correct profile counter increment as it does this: it emits an unconditional increment of the counter for the 'then branch', even if the value selected is from the 'else branch' (this is PR32019). That means, given the following snippet, we would report that "0" is selected twice, and that "1" is never selected: int f1(int x) { return x ? 0 : 1; ^2 ^0 } f1(0); f1(1); Fix the problem by using the instrprof_increment_step intrinsic to do the proper increment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296245 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[profiling] Fix profile counter increment when emitting selects ↵Vedant Kumar2017-02-251-15/+0
| | | | | | | | | | | | | | | | | | | | | (PR32019)" This reverts commit r296231. It causes an assertion failure on 32-bit machines clang: /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/lib/IR/Instructions.cpp:263: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed. llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/./bin/clang+0x1c5fbfa) llvm::sys::RunSignalHandlers() (/export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/./bin/clang+0x1c5dc7e) SignalHandler(int) (/export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/./bin/clang+0x1c5dde2) __restore_rt (/lib64/libpthread.so.0+0x3f1d00efa0) __GI_raise /home/glibctest/rpmbuild/BUILD/glibc-2.17-c758a686/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0 __GI_abort /home/glibctest/rpmbuild/BUILD/glibc-2.17-c758a686/stdlib/abort.c:92:0 __assert_fail_base /home/glibctest/rpmbuild/BUILD/glibc-2.17-c758a686/assert/assert.c:92:0 (/lib64/libc.so.6+0x3f1c82e622) llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&) (/export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/./bin/clang+0x1804e3a) clang::CodeGen::CodeGenPGO::emitCounterIncrement(clang::CodeGen::CGBuilderTy&, clang::Stmt const*, llvm::Value*) (/export/users/atombot/llvm/clang-atom-d525-fedora-rel/stage1/./bin/clang+0x1ec7891) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296234 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] Fix profile counter increment when emitting selects (PR32019)Vedant Kumar2017-02-251-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Clang has logic to lower certain conditional expressions directly into llvm select instructions. However, it does not emit the correct profile counter increment as it does this: it emits an unconditional increment of the counter for the 'then branch', even if the value selected is from the 'else branch' (this is PR32019). That means, given the following snippet, we would report that "0" is selected twice, and that "1" is never selected: int f1(int x) { return x ? 0 : 1; ^2 ^0 } f1(0); f1(1); Fix the problem by using the instrprof_increment_step intrinsic to do the proper increment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296231 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] PR31992: Don't skip interesting non-base constructorsVedant Kumar2017-02-243-1/+62
| | | | | | | | | Fix the fact that we don't assign profile counters to constructors in classes with virtual bases, or constructors with variadic parameters. Differential Revision: https://reviews.llvm.org/D30131 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296062 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] Make a test more explicit. NFC.Vedant Kumar2017-02-181-7/+15
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295532 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] Tighten test cases which refer to "profn" vars. NFC.Vedant Kumar2017-02-182-7/+7
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295528 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] Update test cases to deal with name variable change (NFC)Vedant Kumar2017-02-141-9/+0
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295101 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[profiling] Update test case to deal with name variable change (NFC)"Vedant Kumar2017-02-141-0/+9
| | | | | | | This reverts commit r295085, because the corresponding llvm change was reverted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295100 91177308-0d34-0410-b5e6-96231b3b80d8
* [profiling] Update test case to deal with name variable change (NFC)Vedant Kumar2017-02-141-9/+0
| | | | | | | The 'profn' name variables shouldn't show up after we run the instrprof pass, see https://reviews.llvm.org/D29921 for more details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295085 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix two test cases I missed updating in r291850. Sorry for the noise.Chandler Carruth2017-01-121-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291853 91177308-0d34-0410-b5e6-96231b3b80d8
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-233-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290392 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for D21736.Marcin Koscielnicki2016-11-222-7/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D21741 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287689 91177308-0d34-0410-b5e6-96231b3b80d8
* [Coverage] Support for C++17 if initializersVedant Kumar2016-10-141-0/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D25572 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284293 91177308-0d34-0410-b5e6-96231b3b80d8
* [Coverage] Support for C++17 switch initializersVedant Kumar2016-10-141-0/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D25539 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284292 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Update testcase for r283948 (NFC)Vedant Kumar2016-10-111-1/+1
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283949 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Enable profile merging with -fprofile-generat[=<dir>]Xinliang David Li2016-07-221-1/+1
| | | | | | | | | | This patch enables raw profile merging for this option which is the new intended behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276484 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] update test case with interface change.Xinliang David Li2016-07-212-10/+3
| | | | | | | See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276356 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Add flags for enabling both types of PGO InstrumentationSean Silva2016-07-161-3/+4
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275668 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MaxFunctionCount module flag annotation.Easwaran Raman2016-06-201-24/+0
| | | | | | | | Differential revision: http://reviews.llvm.org/D19184 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273198 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] Fix another use of the driver.Sean Silva2016-04-231-1/+1
| | | | | | Follow-on to r267262. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267263 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] Use cc1 in these tests instead of the driver.Sean Silva2016-04-235-9/+9
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267262 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Avoid instrumenting constants at value sitesBetul Buyukkurt2016-03-311-0/+11
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265037 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Test case fix for r264783 Betul Buyukkurt2016-03-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264795 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Move the instrumentation point closer to the value site.Betul Buyukkurt2016-03-292-2/+24
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264783 91177308-0d34-0410-b5e6-96231b3b80d8
* Attach profile summary information to Module.Easwaran Raman2016-03-242-0/+51
| | | | | | | | | Differential Revision: http://reviews.llvm.org/D18289 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264342 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-0211-13/+13
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262515 91177308-0d34-0410-b5e6-96231b3b80d8
* Test simplificationXinliang David Li2016-02-171-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261047 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Fix issue: explicitly defaulted assignop is not profiledXinliang David Li2016-02-091-0/+32
| | | | | | | | | | | Differential Revision: http://reviews.llvm.org/D16947 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260270 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Cover more cases of implicitly generated C++ methodsXinliang David Li2016-02-081-4/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260161 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify test casesXinliang David Li2016-02-082-22/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260126 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test case problem(caused by clang-formatXinliang David Li2016-02-072-12/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260022 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] add profile/coverage test cases for defaulted ctor/ctorsXinliang David Li2016-02-072-0/+88
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260021 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] cc1 option name change for profile instrumentationRong Xu2016-02-0415-20/+25
| | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259811 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] test case cleanupsXinliang David Li2016-01-284-15/+21
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259067 91177308-0d34-0410-b5e6-96231b3b80d8
* Clang changes for value profilingBetul Buyukkurt2016-01-231-0/+15
| | | | | | | | Differential Revision: http://reviews.llvm.org/D8940 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258650 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove setting of inlinehint and cold attributes based on profile dataEaswaran Raman2016-01-042-50/+2
| | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256793 91177308-0d34-0410-b5e6-96231b3b80d8
* Attach maximum function count to Module when using PGO mode.Easwaran Raman2015-12-172-0/+50
| | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255918 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] make profile prefix even shorter and more readableXinliang David Li2015-12-1515-60/+60
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255587 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Shorten profile symbol prefixesXinliang David Li2015-12-1415-60/+60
| | | | | | | | | | | | (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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255576 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r255445: adding a new test caseXinliang David Li2015-12-131-11/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255447 91177308-0d34-0410-b5e6-96231b3b80d8
* Resubmit new test case after adding more constraintXinliang David Li2015-12-131-0/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255445 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 255436 : remove test that needs to be refinedXinliang David Li2015-12-121-13/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255437 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] add a test case with -no-integrated-asXinliang David Li2015-12-121-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255436 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-125-7/+7
| | | | | | | | | (This is part-2 of the patch of r255434 -- fixing test cases, second try) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255435 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Revert r255366: solution incomplete, not handling lambda yetXinliang David Li2015-12-119-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255368 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Stop using invalid char in instr variable names.Xinliang David Li2015-12-119-13/+13
| | | | | | | | | | | | | | | | | | | (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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255366 91177308-0d34-0410-b5e6-96231b3b80d8