summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* [remark][diagnostics] Using clang diagnostic handler for IR input filesRong Xu2020-01-142-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | For IR input files, we currently use LLVM diagnostic handler even the compilation is from clang. As a result, we are not able to use -Rpass to get the transformation reports. Some warnings are not handled properly either: We found many mysterious warnings in our ThinLTO backend compilations in SamplePGO and CSPGO. An example of the warning: "warning: net/proto2/public/metadata_lite.h:51:21: 0.02% (1 / 4999)" This turns out to be a warning by Wmisexpect, which is supposed to be filtered out by default. But since the filter is in clang's diagnostic hander, we emit these incomplete warnings from LLVM's diagnostic handler. This patch uses clang diagnostic handler for IR input files. We create a fake backendconsumer just to install the diagnostic handler. With this change, we will have proper handling of all the warnings and we can use -Rpass* options in IR input files compilation. Also note that with is patch, LLVM's diagnostic options, like "-mllvm -pass-remarks=*", are no longer be able to get optimization remarks. Differential Revision: https://reviews.llvm.org/D72523
* [clang] Add VFS support for sanitizers' blacklistsJan Korous2019-11-081-0/+15
| | | | Differential Revision: https://reviews.llvm.org/D69648
* Revert r374006: Reland 'Add VFS support for sanitizers' blacklist'Ilya Biryukov2019-10-091-15/+0
| | | | | | | | | | | Also revert follow-up changes to the test. Reason: the patch breaks our internal clang-tidy integration. It's also unclear why we should use getRealPath instead of plumbing the VFS to SanitizerBlacklist, see original commit thread of cfe-commits for a discussion. llvm-svn: 374151
* Reland 'Add VFS support for sanitizers' blacklist'Jan Korous2019-10-081-0/+15
| | | | | | | | | | The original patch broke the test for Windows. Trying to fix as per Reid's suggestions outlined here: https://reviews.llvm.org/rC371663 Differential Revision: https://reviews.llvm.org/D67742 llvm-svn: 374006
* Revert "Add VFS support for sanitizers' blacklist"Jan Korous2019-10-081-15/+0
| | | | | | | | Fix tests on Windows for now. This reverts commit 96ac97a4213287003f08636d0c372b3f71e9cfca. llvm-svn: 373999
* Add VFS support for sanitizers' blacklistJan Korous2019-10-071-0/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D67742 llvm-svn: 373977
* Reland "Change the X86 datalayout to add three address spacesAmy Huang2019-09-104-4/+4
| | | | | | | | | | for 32 bit signed, 32 bit unsigned, and 64 bit pointers." This reverts 57076d3199fc2b0af4a3736b7749dd5462cacda5. Original review at https://reviews.llvm.org/D64931. Review for added fix at https://reviews.llvm.org/D66843. llvm-svn: 371568
* Revert "Change the X86 datalayout to add three address spaces for 32 bit ↵Vlad Tsyrklevich2019-08-284-4/+4
| | | | | | | | | signed," This reverts commit r370083 because it caused check-lld failures on sanitizer-x86_64-linux-fast. llvm-svn: 370142
* Change the X86 datalayout to add three address spaces for 32 bit signed,Amy Huang2019-08-274-4/+4
| | | | | | 32 bit unsigned, and 64 bit pointers. llvm-svn: 370083
* [DebugInfo] Don't emit checksums when compiling a preprocessed CPPAlexandre Ganea2019-05-212-0/+19
| | | | | | | | Fixes PR41215 Differential Revision: https://reviews.llvm.org/D60283 llvm-svn: 361296
* [PGO] Re-submit: Clang part of change for context-sensitive PGO (part2)Rong Xu2019-03-062-0/+4
| | | | | | | | Part 2 of CSPGO change in Clang: Add test cases. Differential Revision: https://reviews.llvm.org/D54176 llvm-svn: 355563
* Revert r355432 for buildbot failures in ppc64be-linux and s390x-linuxRong Xu2019-03-052-4/+0
| | | | llvm-svn: 355454
* [PGO] Clang part of change for context-sensitive PGO (part2)Rong Xu2019-03-052-0/+4
| | | | | | | | Part 2 of CSPGO change in Clang: Add test cases. Differential Revision: https://reviews.llvm.org/D54176 llvm-svn: 355432
* [ThinLTO] Allow importing of multiple symbols with same GUIDTeresa Johnson2018-11-292-0/+26
| | | | | | | | | | | | | | | | | | | Summary: The is the clang side of the fix in D55047, to handle the case where two different modules have local variables with the same GUID because they had the same source file name at compilation time. Allow multiple symbols with the same GUID to be imported, and test that this case works with the distributed backend path. Depends on D55047. Reviewers: evgeny777 Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D55048 llvm-svn: 347887
* [Clang] Add options -fprofile-filter-files and -fprofile-exclude-files to ↵Calixte Denizet2018-11-172-0/+2
| | | | | | | | | | | | | | | | | | filter the files to instrument with gcov (after revert https://reviews.llvm.org/rL346659) Summary: the previous patch (https://reviews.llvm.org/rC346642) has been reverted because of test failure under windows. So this patch fix the test cfe/trunk/test/CodeGen/code-coverage-filter.c. Reviewers: marco-c Reviewed By: marco-c Subscribers: cfe-commits, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D54600 llvm-svn: 347144
* Revert rL346644, rL346642: the added test ↵Calixte Denizet2018-11-122-2/+0
| | | | | | test/CodeGen/code-coverage-filter.c is failing under windows llvm-svn: 346659
* [Clang] Add options -fprofile-filter-files and -fprofile-exclude-files to ↵Calixte Denizet2018-11-122-0/+2
| | | | | | | | | | | | | | | | | | | | | | filter the files to instrument with gcov Summary: These options are taking regex separated by colons to filter files. - if both are empty then all files are instrumented - if -fprofile-filter-files is empty then all the filenames matching any of the regex from exclude are not instrumented - if -fprofile-exclude-files is empty then all the filenames matching any of the regex from filter are instrumented - if both aren't empty then all the filenames which match any of the regex in filter and which don't match all the regex in filter are instrumented - this patch is a follow-up of https://reviews.llvm.org/D52033 Reviewers: marco-c, vsk Reviewed By: marco-c, vsk Subscribers: cfe-commits, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D52034 llvm-svn: 346642
* [DebugInfo] Support DWARF v5 source code embedding extensionScott Linder2018-02-261-0/+1
| | | | | | | | | | | | | In DWARF v5 the Line Number Program Header is extensible, allowing values with new content types. This vendor extension to DWARF v5 allows source text to be embedded directly in the line tables of the debug line section. Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates that source should be passed through to LLVM during CodeGen. Differential Revision: https://reviews.llvm.org/D42766 llvm-svn: 326102
* [ThinLTO] Allow indexing to request backend to ignore the moduleVitaly Buka2018-02-161-0/+0
| | | | | | | | | | | | | | | | | | Summary: Gold plugin does not add pass to ThinLTO modules without useful symbols. In this case ThinLTO can't create corresponding index file and some features, like CFI, cannot be processes by backed correctly without index. Given that we don't need the backed output we can request it to avoid processing the module. This is implemented by this patch using new "SkipModuleByDistributedBackend" flag. Reviewers: pcc, tejohnson Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D42995 llvm-svn: 325411
* Allow specifying sanitizers in blacklistsVlad Tsyrklevich2017-09-255-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the follow-up patch to D37924. This change refactors clang to use the the newly added section headers in SpecialCaseList to specify which sanitizers blacklists entries should apply to, like so: [cfi-vcall] fun:*bad_vcall* [cfi-derived-cast|cfi-unrelated-cast] fun:*bad_cast* The SanitizerSpecialCaseList class has been added to allow querying by SanitizerMask, and SanitizerBlacklist and its downstream users have been updated to provide that information. Old blacklists not using sections will continue to function identically since the blacklist entries will be placed into a '[*]' section by default matching against all sanitizers. Reviewers: pcc, kcc, eugenis, vsk Reviewed By: eugenis Subscribers: dberris, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37925 llvm-svn: 314171
* Revert r307445 as it breaks on certain platforms.Dehao Chen2017-07-071-7/+2
| | | | llvm-svn: 307449
* Add sample PGO integration test to cover profile annotation and inlining.Dehao Chen2017-07-071-2/+7
| | | | | | | | | | | | | | Summary: The patch makes the integration test cover major sample PGO components. Reviewers: davidxl Reviewed By: davidxl Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D34725 llvm-svn: 307445
* Apply summary-based dead stripping to regular LTO modules with summaries.Peter Collingbourne2017-06-151-0/+9
| | | | | | | | | | | | | | | If a regular LTO module has a summary index, then instead of linking it into the combined regular LTO module right away, add it to the combined summary index and associate it with a special module that represents the combined regular LTO module. Any such modules are linked during LTO::run(), at which time we use the results of summary-based dead stripping to control whether to link prevailing symbols. Differential Revision: https://reviews.llvm.org/D33922 llvm-svn: 305482
* Update the SamplePGO test to verify that unroll/icp is not invoked in ↵Dehao Chen2017-03-231-0/+2
| | | | | | | | | | | | | | | | thinlto compile phase. Summary: This is the test added for https://reviews.llvm.org/D31217 Reviewers: tejohnson, mehdi_amini Reviewed By: tejohnson Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31219 llvm-svn: 298647
* Clang change: Do not inline hot callsites for samplepgo in thinlto compile ↵Dehao Chen2017-03-211-0/+2
| | | | | | | | | | | | | | | | | | phase. Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro file, thus we do not want to inline hot callsites in the first phase. Reviewers: tejohnson, eraman Reviewed By: tejohnson Subscribers: mehdi_amini, cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31202 llvm-svn: 298429
* Move test include file from include/ to Inputs/Richard Trieu2017-02-111-0/+12
| | | | | | | The Inputs/ directory is the recommended location for extra files for test cases. No functional change. llvm-svn: 294815
* [DebugInfo] Added support for Checksum debug info feature.Amjad Aboud2016-12-251-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D27641 llvm-svn: 290515
* Add an option to save the backend-produced YAML optimization record to a fileHal Finkel2016-10-111-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | The backend now has the capability to save information from optimizations, the same information that can be used to generate optimization diagnostics but in machine-consumable form, into an output file. This can be enabled when using opt (see r282539), and this change enables it when using clang. The idea is that other tools will be able to consume these files, and perhaps in combination with the original source code, produce various kinds of optimization reports for users (and for compiler developers). We now have at-least two tools that can consume these files: * tools/llvm-opt-report * utils/opt-viewer Using the flag -fsave-optimization-record will cause the YAML file to be generated; the file name will be based on the output file name (if we're using -c or -S and have an output name), or the input file name. When we're using CUDA, or some other offloading mechanism, separate files are generated for each backend target. The output file name can be specified by the user using -foptimization-record-file=filename. Differential Revision: https://reviews.llvm.org/D25225 llvm-svn: 283834
* CodeGen: Replace test/CodeGen/thinlto_backend.c with a functional test.Peter Collingbourne2016-06-221-0/+6
| | | | | | | | | | | This new test tests that functions are capable of being imported, rather than that the import pass is run. This new test is compatible with the approach being developed in D20268 which runs the importer on its own rather than in a pass. Differential Revision: http://reviews.llvm.org/D21542 llvm-svn: 273347
* Invoke PruneEH pass before Sample Profile pass.Dehao Chen2016-06-211-0/+2
| | | | | | | | | | | | Summary: We need to call PruneEH pass before AutoFDO pass so that some EH-related calls can get inlined in Sample Profile pass. Reviewers: davidxl, dnovillo Subscribers: junbuml, llvm-commits Differential Revision: http://reviews.llvm.org/D21197 llvm-svn: 273298
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-022-0/+2
| | | | | | | | | | | | | | | | | | 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
* test: change argumentSaleem Abdulrasool2015-10-121-1/+1
| | | | | | | This failed on AArch64 due to the type mismatch using int instead of __builtin_va_list. llvm-svn: 250112
* test: Give instrumentation based profiling tests their own directoryJustin Bogner2014-03-112-177/+0
| | | | | | | | 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
* PGO: rename profile data files from .pgodata to .profdata.Bob Wilson2014-03-062-0/+0
| | | | | | | These tests were added before we had settled on using a .profdata extension for the profile data files. Renaming them now for consistency. llvm-svn: 203166
* PGO: Use the main file name to help distinguish functions with local linkage.Bob Wilson2014-03-061-0/+4
| | | | | | | | | | | | In addition, for all functions, use the name from the llvm::Function to identify the function in the profile data. Compute that "function name", including the file name for local functions, once when assigning the PGO counters and store it in the CodeGenPGO class. Move the code to add InlineHint and Cold attributes out of StartFunction(), because the "function name" string isn't available at that point. llvm-svn: 203075
* Add a testcase for r202437.Bob Wilson2014-02-281-0/+6
| | | | llvm-svn: 202468
* Change PGO instrumentation to compute counts in a separate AST traversal.Bob Wilson2014-02-171-36/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we made one traversal of the AST prior to codegen to assign counters to the ASTs and then propagated the count values during codegen. This patch now adds a separate AST traversal prior to codegen for the -fprofile-instr-use option to propagate the count values. The counts are then saved in a map from which they can be retrieved during codegen. This new approach has several advantages: 1. It gets rid of a lot of extra PGO-related code that had previously been added to codegen. 2. It fixes a serious bug. My original implementation (which was mailed to the list but never committed) used 3 counters for every loop. Justin improved it to move 2 of those counters into the less-frequently executed breaks and continues, but that turned out to produce wrong count values in some cases. The solution requires visiting a loop body before the condition so that the count for the condition properly includes the break and continue counts. Changing codegen to visit a loop body first would be a fairly invasive change, but with a separate AST traversal, it is easy to control the order of traversal. I've added a testcase (provided by Justin) to make sure this works correctly. 3. It improves the instrumentation overhead, reducing the number of counters for a loop from 3 to 1. We no longer need dedicated counters for breaks and continues, since we can just use the propagated count values when visiting breaks and continues. To make this work, I needed to make a change to the way we count case statements, going back to my original approach of not including the fall-through in the counter values. This was necessary because there isn't always an AST node that can be used to record the fall-through count. Now case statements are handled the same as default statements, with the fall-through paths branching over the counter increments. While I was at it, I also went back to using this approach for do-loops -- omitting the fall-through count into the loop body simplifies some of the calculations and make them behave the same as other loops. Whenever we start using this instrumentation for coverage, we'll need to add the fall-through counts into the counter values. llvm-svn: 201528
* PGO: fix a bug in parsing pgo data.Manman Ren2014-02-151-0/+3
| | | | | | | | When a function has a single counter, we will offset the pointer by 1 when parsing the next function. If a function has multiple counters, we are okay after skipping rest of the counters. llvm-svn: 201456
* PGO: instrumentation based profiling sets function attributes.Manman Ren2014-02-051-0/+39
| | | | | | | | | | | | | | | We collect a maximal function count among all functions in the pgo data file. For functions that are hot, we set its InlineHint attribute. For functions that are cold, we set its Cold attribute. We currently treat functions with >= 30% of the maximal function count as hot and functions with <= 1% of the maximal function count are treated as cold. These two numbers are from preliminary tuning on SPEC. This commit should not affect non-PGO builds and should boost performance on instrumentation based PGO. llvm-svn: 200874
* CodeGen: Fix tracking of PGO counters for the logical or operatorJustin Bogner2014-01-231-0/+12
| | | | | | | This adds tests for both logical or and for logical and, which was already correct. llvm-svn: 199865
* CodeGen: Initial instrumentation based PGO implementationJustin Bogner2014-01-061-0/+127
| | | | llvm-svn: 198640
* Add testcase for r148375!Nick Lewycky2012-01-181-0/+9
llvm-svn: 148378
OpenPOWER on IntegriCloud