summaryrefslogtreecommitdiffstats
path: root/clang/test/Profile
Commit message (Collapse)AuthorAgeFilesLines
...
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-158-99/+99
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* InstrProf: Use LLVM's -instrprof pass for profilingJustin Bogner2014-12-083-13/+16
| | | | | | | | The logic for lowering profiling counters has been moved to an LLVM pass. Emit the intrinsics rather than duplicating the whole pass in clang. llvm-svn: 223683
* InstrProf: Use the same names for variables as we use in the profileJustin Bogner2014-12-025-10/+10
| | | | | | | | There's no need to use different names for the local variables than we use in the profile itself, and it's a bit simpler and easier to debug if we're consistent. llvm-svn: 223173
* InstrProf: Update for LLVM API changeJustin Bogner2014-08-012-0/+3
| | | | | | | | | | | | We've added support for a multiple functions with the same name in LLVM's profile data, so the lookup returning the function hash it found doesn't make sense anymore. Update to pass in the hash we expect. This also adds a test that the version 1 format is still readable, since the new API is expected to handle that. llvm-svn: 214586
* CodeGen: Improve warnings about uninstrumented files when profilingJustin Bogner2014-06-263-0/+39
| | | | | | | | | Improve the warning when building with -fprofile-instr-use and a file appears not to have been profiled at all. This keys on whether a function is defined in the main file or not to avoid false negatives when one includes a header with functions that have been profiled. llvm-svn: 211760
* InstrProf: Set profile data to visibility hiddenDuncan P. N. Exon Smith2014-05-169-42/+42
| | | | | | | | | | | | | Shared objects are fairly broken for InstrProf right now -- a follow-up commit in compiler-rt will fix the rest of this. The main problem here is that at link time, profile data symbols in the shared object might get used instead of symbols from the main executable, creating invalid profile data sections. <rdar://problem/16918688> llvm-svn: 208939
* CodeGen: Avoid instrumenting implicit Decls more effectivelyJustin Bogner2014-04-251-0/+17
| | | | | | | | | | We don't assign counters for implicit Decls, but we were emitting code to increment the (non-existent) counters and adding empty counter lists in the output. This fixes the checks in assignRegionCounters and emitInstrumentationData to do the right thing, and adds an assert for the pathological case of emitting zero counters. llvm-svn: 207203
* test: Use llvm-profdata merge in Profile testsJustin Bogner2014-04-1722-12/+26
| | | | | | | | | | | In preparation for using a binary format for instrumentation based profiling, explicitly treat the test inputs as text and transform them before running. This will allow us to leave the checked in files in human readable format once the instrumentation format is binary. No functional change. llvm-svn: 206509
* Fix Profile:cxx-lambda.cpp test for targets that do not generate zeroextKeith Walker2014-04-171-2/+2
| | | | | | | Change an expected match to allow for the fact that some targets may not generated the zeroext operation. llvm-svn: 206467
* InstrProf: Calculate a better function hashDuncan P. N. Exon Smith2014-04-1614-49/+49
| | | | | | | | | | | | | | | | | | The function hash should change when control flow changes. This patch hashes the type of each AST node that affects counters, rather than just counting how many there are. These types are combined into a small enumerator that currently has 16 values. The new hash algorithm packs the enums for consecutively visited types into a `uint64_t`. In order to save space for new types, the types are assumed to be 6-bit values (instead of 4-bit). In order to minimize overhead for functions with little control flow, the `uint64_t` is used directly as a hash if it never fills up; if it does, it's passed through an MD5 context. <rdar://problem/16435801> llvm-svn: 206397
* CodeGen: Emit warnings for out of date profile data during PGOJustin Bogner2014-04-151-5/+8
| | | | | | | | | This adds a warning that triggers when profile data doesn't match for the source that's being compiled with -fprofile-instr-use=. This fires only once per translation unit, as warning on every mismatched function would be quite noisy. llvm-svn: 206322
* CodeGen: Handle CapturedStmt in instrumentation based profilingJustin Bogner2014-04-152-0/+82
| | | | | | | | CapturedStmt was being ignored by instrumentation based profiling, and its counters attributed to the containing function. Instead, we need to treat this as a top level entity, like we do with blocks. llvm-svn: 206231
* CodeGen: Test instrumentation based profiling of templatesJustin Bogner2014-04-122-0/+58
| | | | | | | Make sure that templates are handled correctly by profile instrumentation. llvm-svn: 206091
* CodeGen: Fix handling of C++11 lambdas in profilingJustin Bogner2014-04-112-0/+77
| | | | | | | | | Until now we were generating duplicate counters for lambdas: one set in the function where the lambda was declared and another for the lambda itself. Instead, we should skip over the bodies of lambdas in their containing contexts. llvm-svn: 206081
* CodeGen: Handle binary conditional operators in PGO instrumentationJustin Bogner2014-04-112-0/+29
| | | | | | | This treats binary conditional operators in the same way as ternary conditional operators for instrumentation based profiling. llvm-svn: 206021
* CodeGen: Don't create branch weight metadata from empty profilesJustin Bogner2014-04-042-0/+100
| | | | | | | | | | | If all of our weights are zero when calculating branch weights, it means we haven't profiled the code in question. Avoid creating a metadata node that says all branches are equally likely in this case. The test also checks constructs that hit the other createBranchWeights overload. These were already working. llvm-svn: 205606
* InstrProf: Emit runtime hook directly in IRGenDuncan P. N. Exon Smith2014-03-282-2/+14
| | | | | | | | | | | | | | | | | | -u behaviour is apparently not portable between linkers (see cfe-commits discussions for r204379 and r205012). I've moved the logic to IRGen, where it should have been in the first place. I don't have a Linux system to test this on, so it's possible this logic *still* doesn't pull in the instrumented profiling runtime on Linux. I'm in the process of getting tests going on the compiler-rt side (llvm-commits "[PATCH] InstrProf: Add initial compiler-rt test"). Once we have tests for the full flow there, the runtime logic should get a whole lot less brittle. <rdar://problem/16458307> llvm-svn: 205023
* [PGO] Add simplified branch weights for Objective-C for-collection loops.Bob Wilson2014-03-251-1/+4
| | | | | | | | | | | | | Conceptually one of these loops is just a while-loop, but the actual code-gen is more complicated. We don't instrument all the different control flow edges to get accurate counts for each conditional branch, nor do I think it makes sense to do so. Instead, make the simplifying assumption that the loop behaves like a while-loop. Use the same branch weights for the first check for an empty collection as would be used for the back-edge of a while loop, and use that same weighting for the innermost loop, ignoring the possibility that there may be some extra code to go fetch more elements. llvm-svn: 204767
* PGO: Don't define instrumentation data available_externallyDuncan P. N. Exon Smith2014-03-201-0/+12
| | | | | | | | | | | | | | | Variables with available_externally linkage can be dropped at will. This causes link errors, since there are still references to the instrumentation! linkonce_odr is almost equivalent, so use that instead. As a drive-by fix (I don't have an Elf system, so I'm not sure how to write a testcase), use linkonce linkage for the instrumentation of extern_weak functions. <rdar://problem/15943240> llvm-svn: 204408
* PGO: Change runtime prefix from pgo to profileDuncan P. N. Exon Smith2014-03-206-45/+45
| | | | | | | | | | | These functions are in the profile runtime. PGO comes later. Unfortunately, there's only room for 16 characters in a Darwin section, so use __llvm_prf_ instead of __llvm_profile_ for section names. <rdar://problem/15943240> llvm-svn: 204390
* CodeGen: Include a function hash in instrumentation based profilingJustin Bogner2014-03-189-41/+103
| | | | | | | | | The hash itself is still the number of counters, which isn't all that useful, but this separates the API changes from the actual implementation of the hash and will make it easier to transition to the ProfileData library once it's implemented. llvm-svn: 204186
* PGO: Statically generate data structuresDuncan P. N. Exon Smith2014-03-177-20/+80
| | | | | | | | | | | | | | | | | | | In instrumentation-based profiling, we need a set of data structures to represent the counters. Previously, these were built up during static initialization. Now, they're shoved into a specially-named section so that they show up as an array. As a consequence of the reorganizing symbols, instrumentation data structures for linkonce functions are now correctly coalesced. This is the first step in a larger project to minimize runtime overhead and dependencies in instrumentation-based profilng. The larger picture includes removing all initialization overhead and making the dependency on libc optional. <rdar://problem/15943240> llvm-svn: 204080
* Revert "CodeGen: Use a binary format for instrumentation based profiling"Justin Bogner2014-03-127-0/+0
| | | | | | | | | I've clearly done something wrong with how to get this to link correctly. Reverting for now. This reverts commit r203711. llvm-svn: 203712
* CodeGen: Use a binary format for instrumentation based profilingJustin Bogner2014-03-127-0/+0
| | | | | | | | This updates CodeGenPGO to use the ProfileDataReader introduced to llvm in r203703 and the new API for writing out the profile introduced to compiler-rt in r203710. llvm-svn: 203711
* PGO: appease the bots after r203592Duncan P. N. Exon Smith2014-03-111-1/+1
| | | | llvm-svn: 203618
* PGO: Clarify the testing READMEDuncan P. N. Exon Smith2014-03-111-8/+16
| | | | | | <rdar://problem/16276448> llvm-svn: 203593
* PGO: Scale large counters down to 32-bitsDuncan P. N. Exon Smith2014-03-112-0/+59
| | | | | | | | | PGO counters are 64-bit and branch weights are 32-bit. Scale them down when necessary, instead of just taking the lower 32 bits. <rdar://problem/16276448> llvm-svn: 203592
* test: Regenerate profile data for PGO testsJustin Bogner2014-03-118-58/+56
| | | | | | | | Some of this data had gotten out of date, so we weren't quite testing what we thought we were. This also moves the outdated data test to its own file to simplify regenerating the test data. llvm-svn: 203546
* test: Give instrumentation based profiling tests their own directoryJustin Bogner2014-03-1111-0/+1032
These tests are logically related, but they're spread about several different CodeGen directories. Consolidate them in one place to make them easier to manage. llvm-svn: 203541
OpenPOWER on IntegriCloud