summaryrefslogtreecommitdiffstats
path: root/clang/test/Profile
Commit message (Collapse)AuthorAgeFilesLines
* Fix a soon to be invalid testXinliang David Li2015-10-291-1/+0
| | | | | | | Remove a check that won't be valid when LLVM stops emitting runtime hook user function. llvm-svn: 251611
* Tweak a couple of -fprofile tests in clang/test to accept backslash in path.NAKAMURA Takumi2015-07-101-1/+1
| | | | llvm-svn: 241903
* Remove test that tests referring to the current working directory. YouDaniel Jasper2015-07-101-5/+0
| | | | | | | | | 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
* Add GCC-compatible flags -fprofile-generate and -fprofile-use.Diego Novillo2015-07-092-0/+53
| | | | | | | | | | | | | | | | | | 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
* Fix a couple of tests in clang/test to match "x86_thiscallcc" introduced in ↵NAKAMURA Takumi2015-06-301-2/+2
| | | | | | r240971. llvm-svn: 241047
* Account for calling convention specifiers in function definitions in IR test ↵David Blaikie2015-06-293-9/+9
| | | | | | | | | | | | | cases Several tests wouldn't pass when executed on an armv7a_pc_linux triple due to the non-default arm_aapcs calling convention produced on the function definitions in the IR output. Account for this with the application of a little regex. Patch by Ying Yi. llvm-svn: 240971
* Display profile file name when emitting a file not found diagnostic.Diego Novillo2015-06-251-1/+1
| | | | | | | | | When a profile file cannot be opened, we used to display just the error message but not the name of the profile the compiler was trying to open. This will become useful in the next set of patches that introduce GCC-compatible flags to specify profiles. llvm-svn: 240715
* Fix PPC failure. Adjust CHECK pattern.Diego Novillo2015-05-281-2/+2
| | | | llvm-svn: 238413
* Set function entry counts with -fprofile-instr-use.Diego Novillo2015-05-272-0/+29
| | | | | | This generates function entry counts from instrumentation profiles. llvm-svn: 238360
* InstrProf: Change this triple back to %itanium_abi_tripleJustin Bogner2015-05-201-1/+1
| | | | | | | In my rush to fix the linux bots in r237805, I accidentally committed a change to the triple. Revert that part. llvm-svn: 237806
* InstrProf: Remove darwin-specific section names from this testJustin Bogner2015-05-201-5/+5
| | | | llvm-svn: 237805
* InstrProf: Increment the profile counter for all types of destructorJustin Bogner2015-05-201-0/+30
| | | | | | | | | | | | -fprofile-instr-generate does not emit counter increment intrinsics for Dtor_Deleting and Dtor_Complete destructors with assigned counters. This causes unnecessary [-Wprofile-instr-out-of-date] warnings during profile-use runs even if the source has never been modified since profile collection. Patch by Betul Buyukkurt. Thanks! llvm-svn: 237804
* InstrProf: Update name of compiler-rt routine for setting filenameJustin Bogner2015-05-121-2/+2
| | | | | | Patch by Teresa Johnson. llvm-svn: 237187
* Changed renaming of local symbols by inserting a dot vefore the numeric suffixSunil Srivastava2015-05-122-3/+3
| | | | | | | details in http://reviews.llvm.org/D9483 goes with llvm checkin r237150 llvm-svn: 237151
* InstrProf: Add a couple of checks to this testJustin Bogner2015-05-011-0/+15
| | | | | | | "Don't crash" tests are silly, we might as well check that the counters are consistent here. llvm-svn: 236361
* InstrProf: Support for setting profile output from command lineJustin Bogner2015-04-301-0/+10
| | | | | | | | | | | | | | | | This change is the third of 3 patches to add support for specifying the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. This patch adds the necessary support to the clang frontend, and adds a new test. The compiler-rt and llvm parts are r236055 and r236288, respectively. Patch by Teresa Johnson. Thanks! llvm-svn: 236289
* InstrProf: Fix handling of profile counters in the body of range based forJustin Bogner2015-04-302-0/+57
| | | | | | | | | We were assigning the counter for the body of the loop to the loop variable initialization for some reason here, but our tests completely lacked coverage for range-for loops. This fixes that and makes the logic generally more similar to the logic for a regular for. llvm-svn: 236277
* InstrProf: Match a bit less strictly - some targets may add signextJustin Bogner2015-04-281-2/+2
| | | | | | | | Notably, this bot didn't like it: http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/5117 llvm-svn: 235968
* InstrProf: Mark code regions after throw expressions as unreachableJustin Bogner2015-04-282-2/+30
| | | | | | | We weren't setting regions as being unreachable after C++ throw expressions, leading to incorrect count propagations. llvm-svn: 235967
* Fix this test so it doesn't try to open a file to write to the source treeDavid Blaikie2015-04-061-1/+1
| | | | llvm-svn: 234173
* clang/test/Profile/profile-does-not-exist.c: Avoid checking a message line ↵NAKAMURA Takumi2015-04-061-1/+1
| | | | | | in the message catalog. llvm-svn: 234146
* Don't crash when passing a non-existent file to -fprofile-instr-use=.Nico Weber2015-04-061-0/+4
| | | | | | Fixes a regression from r229434. llvm-svn: 234141
* Re-land "MS ABI: lambda call operators are instance methods and should use ↵Reid Kleckner2015-04-011-2/+2
| | | | | | | | | | | | | thiscall" Update the test cases to pass when lambda call operators use thiscall. Update the lambda-to-block conversion operator to use the default free function calling convention instead of the call operator's convention. This reverts commit r233082 and re-instates r233023. llvm-svn: 233835
* InstrProf: Make profile variables private to reduce binary size overheadJustin Bogner2015-03-208-28/+28
| | | | | | | | | | | | When we instrument a program for profiling, we copy the linkage of an instrumented function so that our datastructures merge in the same way as the function. This avoids redundant copies for things like linkonce, but ends up emitting names we never need to reference for normal and internal symbols. Promoting internal and external linkage to private for these variables reduces the size overhead of profiling drastically. llvm-svn: 232799
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-131-1/+1
| | | | llvm-svn: 232187
* Add -frtti/-fexceptions to some more tests that assume they're onFilipe Cabecinhas2015-02-261-4/+4
| | | | llvm-svn: 230656
* InstrProf: Simplify a couple of tests after r230383Justin Bogner2015-02-242-41/+9
| | | | | | | | | Most of the checks in these two tests were actually testing the behaviour of the instrprof LLVM pass. Now that we're testing that specifically in LLVM's test suite, it's better if we only test the frontend's behaviour here. llvm-svn: 230387
* InstrProf: Don't emit counter increments in dead codeJustin Bogner2015-01-091-0/+15
| | | | | | | | | We were previously emitting counter increments even if we didn't have an insertion point, which would result in a CallInst with no parent. This leads to a crash, as in pr22166, if we try to do GlobalDCE. llvm-svn: 225495
* 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
OpenPOWER on IntegriCloud