summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Constants] If we already have a ConstantInt*, prefer to use ↵Craig Topper2017-07-061-1/+1
| | | | | | | | isZero/isOne/isMinusOne instead of isNullValue/isOneValue/isAllOnesValue inherited from Constant. NFCI Going through the Constant methods requires redetermining that the Constant is a ConstantInt and then calling isZero/isOne/isMinusOne. llvm-svn: 307292
* [PATCH] [PGO] Fixed cast operation in ↵Ana Pazos2017-06-191-1/+1
| | | | | | | | | | | | | | emIntrinsicVisitor::instrumentOneMemIntrinsic. Reviewers: xur, efriedma, davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34293 llvm-svn: 305737
* [PartialInlining] Emit branch info and profile data as remarksXinliang David Li2017-06-011-0/+64
| | | | | | | | | This allows us to collect profile statistics to tune static branch prediction. Differential Revision: http://reviews.llvm.org/D33746 llvm-svn: 304452
* Fix a couple of typos in memory intrinsic optimization output (NFC)Teresa Johnson2017-05-241-1/+1
| | | | | | s/instrinsic/intrinsic llvm-svn: 303782
* [PGO] Memory intrinsic calls optimization based on profiled sizeRong Xu2017-04-041-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes two memory intrinsic operations: memset and memcpy based on the profiled size of the operation. The high level transformation is like: mem_op(..., size) ==> switch (size) { case s1: mem_op(..., s1); goto merge_bb; case s2: mem_op(..., s2); goto merge_bb; ... default: mem_op(..., size); goto merge_bb; } merge_bb: Differential Revision: http://reviews.llvm.org/D28966 llvm-svn: 299446
* [PGO] Change the internal options description. nfc.Rong Xu2017-03-171-3/+5
| | | | llvm-svn: 298120
* [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-171-5/+22
| | | | | | | | This patch annotates the valuesites profile to memory intrinsics. Differential Revision: http://reviews.llvm.org/D31002 llvm-svn: 298110
* Resubmit r297897: [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-161-2/+86
| | | | | | | R297897 inadvertently enabled annotation for memop profiling. This new patch fixed it. llvm-svn: 297996
* Revert "[PGO] Value profile for size of memory intrinsic calls"Eric Liu2017-03-161-83/+1
| | | | | | This commit reverts r297897 and r297909. llvm-svn: 297951
* Revert "Revert "[PGO] Minor cleanup for count instruction in ↵Vitaly Buka2017-03-151-1/+4
| | | | | | | | | | SelectInstVisitor."" Previously reverted wrong revision. This reverts commit r297910. llvm-svn: 297911
* Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor."Vitaly Buka2017-03-151-4/+1
| | | | | | | | Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test This reverts commit r297892. llvm-svn: 297910
* [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-151-1/+83
| | | | | | | | | This patch adds the value profile support to profile the size parameter of memory intrinsic calls: memcpy, memcmp, and memmov. Differential Revision: http://reviews.llvm.org/D28965 llvm-svn: 297897
* [PGO] Minor cleanup for count instruction in SelectInstVisitor.Rong Xu2017-03-151-1/+4
| | | | | | | | | | | | | | | | | Summary: NSIs can be double-counted by different operations in SelectInstVisitor. Sink the the update to VM_counting mode only. Also reset the value for each counting operation. Reviewers: davidxl Reviewed By: davidxl Subscribers: xur, llvm-commits Differential Revision: https://reviews.llvm.org/D30999 llvm-svn: 297892
* [PGO] Refactor the code for value profile annotationRong Xu2017-03-151-29/+38
| | | | | | | | | This patch refactors the code for value profile annotation to facilitate of adding other kind of value profiles. Differential Revision: http://reviews.llvm.org/D30989 llvm-svn: 297870
* Minor format change. nfc.Rong Xu2017-03-091-5/+5
| | | | llvm-svn: 297400
* Fix variable name /NFCXinliang David Li2017-02-041-2/+2
| | | | llvm-svn: 294090
* [PGO] Add select instr profile in graph dumpXinliang David Li2017-02-031-3/+32
| | | | | | Differential Revision: http://reviews.llvm.org/D29474 llvm-svn: 294055
* [PGO] internal option cleanupsXinliang David Li2017-02-021-23/+37
| | | | | | | | | | 1. Added comments for options 2. Added missing option cl::desc field 3. Uniified function filter option for graph viewing. Now PGO count/raw-counts share the same filter option: -view-bfi-func-name=. llvm-svn: 293938
* [PGO] make graph view internal options available for all buildsXinliang David Li2017-02-021-2/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D29259 llvm-svn: 293921
* [PGO] add debug option to view raw count after prof use annotationXinliang David Li2017-01-271-1/+59
| | | | | | Differential Revision: https://reviews.llvm.org/D29045 llvm-svn: 293325
* [PGO] add debug option to view annotated cfg after prof use annotationXinliang David Li2017-01-231-0/+25
| | | | | | Differential Revision: http://reviews.llvm.org/D28967 llvm-svn: 292815
* Resubmit "[PGO] Turn off comdat renaming in IR PGO by default"Rong Xu2017-01-111-15/+13
| | | | | | This patch resubmits the changes in r291588. llvm-svn: 291696
* Revert "[PGO] Turn off comdat renaming in IR PGO by default"Rong Xu2017-01-101-2/+14
| | | | | | | This patch reverts r291588: [PGO] Turn off comdat renaming in IR PGO by default, as we are seeing some hash mismatches in our internal tests. llvm-svn: 291621
* [PGO] Turn off comdat renaming in IR PGO by defaultRong Xu2017-01-101-14/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: In IR PGO we append the function hash to comdat functions to avoid the potential hash mismatch. This turns out not legal in some cases: if the comdat function is address-taken and used in comparison. Renaming changes the semantic. This patch turns off comdat renaming by default. To alleviate the hash mismatch issue, we now rename the profile variable for comdat functions. Profile allows co-existing multiple versions of profiles with different hash value. The inlined copy will always has the correct profile counter. The out-of-line copy might not have the correct count. But we will not have the bogus mismatch warning. Reviewers: davidxl Subscribers: llvm-commits, xur Differential Revision: https://reviews.llvm.org/D28416 llvm-svn: 291588
* [PGO] Fix insane counts due to nonreturn callsRong Xu2016-12-131-2/+11
| | | | | | | | | | | | | | | | Summary: Since we don't break BBs for function calls. We might get some insane counts (wrap of unsigned) in the presence of noreturn calls. This patch sets these counts to zero instead of the wrapped number. Reviewers: davidxl Subscribers: xur, eraman, llvm-commits Differential Revision: https://reviews.llvm.org/D27602 llvm-svn: 289521
* [PGO] Fix PGO use ICE when there are unreachable BBsRong Xu2016-12-021-21/+45
| | | | | | | | | | | | | | For -O0 there might be unreachable BBs, which breaks the assumption that all the BBs have an auxiliary data structure. In this patch, we add another interface called findBBInfo() so that a nullptr can be returned for the unreachable BBs (and the callers can ignore those BBs). This fixes the bug reported https://llvm.org/bugs/show_bug.cgi?id=31209 Differential Revision: https://reviews.llvm.org/D27280 llvm-svn: 288528
* [PGO] Fix select instruction annotationRong Xu2016-10-251-4/+13
| | | | | | | | | | | | | | | | Summary: Select instruction annotation in IR PGO uses the edge count to infer the branch count. It's currently placed in setInstrumentedCounts() where no all the BB counts have been computed. This leads to wrong branch weights. Move the annotation after all BB counts are populated. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25961 llvm-svn: 285128
* [PGO] Create weak alias for the renamed Comdat functionRong Xu2016-10-061-0/+4
| | | | | | | | | | Add a weak alias to the renamed Comdat function in IR level instrumentation, using it's original name. This ensures the same behavior w/ and w/o IR instrumentation, even for non standard conforming code. Differential Revision: http://reviews.llvm.org/D25339 llvm-svn: 283490
* Use StringRef in Pass/PassManager APIs (NFC)Mehdi Amini2016-10-011-6/+2
| | | | llvm-svn: 283004
* code cleanup -- commoning IR travsersalsXinliang David Li2016-09-201-3/+5
| | | | llvm-svn: 282034
* [Profile] Do not annotate select insts not covered in profile.Xinliang David Li2016-09-201-1/+2
| | | | | | Fixed PR/30466 llvm-svn: 282009
* Fix covered-switch-default warningSimon Pilgrim2016-09-181-5/+4
| | | | llvm-svn: 281865
* Fix built bot failureXinliang David Li2016-09-181-1/+1
| | | | llvm-svn: 281859
* [Profile] Implement select instruction instrumentation in IR PGOXinliang David Li2016-09-181-9/+133
| | | | | | Differential Revision: http://reviews.llvm.org/D23727 llvm-svn: 281858
* [Profile] Fix edge count read bugXinliang David Li2016-08-191-2/+2
| | | | | | Use uint64_t to avoid value truncation before scaling. llvm-svn: 279213
* [Profile] Simple code refactoring for reuse /NFCXinliang David Li2016-08-191-12/+16
| | | | llvm-svn: 279209
* [Profile] improve warning control option Xinliang David Li2016-08-111-3/+4
| | | | | | | | | Change --no-pgo-warn-missing to -pgo-warn-missing-function and negate the default. /NFC Add more test to make sure the warning is off by default llvm-svn: 278314
* [Profile] turn off verbose warnings by defaultXinliang David Li2016-08-091-1/+1
| | | | | | | | | no prof data for func warning is turned off by default due to its high verbosity and minimal usefulness. Differential Revision: http://reviews.llvm.org/D23295 llvm-svn: 278127
* Consistently use ModuleAnalysisManagerSean Silva2016-08-091-2/+2
| | | | | | | | | | | Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278078
* [Profile] IR profiling minor cleanup /nfcXinliang David Li2016-08-011-5/+15
| | | | | | Differential Revision: http://reviews.llvm.org/D22995 llvm-svn: 277379
* [PGO] Fix profile mismatch in COMDAT function with pre-inlinerRong Xu2016-07-251-15/+140
| | | | | | | | | | | | | | | | | | Pre-instrumentation inline (pre-inliner) greatly improves the IR instrumentation code performance, among other benefits. One issue of the pre-inliner is it can introduce CFG-mismatch for COMDAT functions. This is due to the fact that the same COMDAT function may have different early inline decisions across different modules -- that means different copies of COMDAT functions will have different CFG checksum. In this patch, we propose a partially renaming the COMDAT group and its member function/variable so we have different profile counter for each version. We will post-fix the COMDAT function and the group name with its FunctionHash. Differential Revision: http://reviews.llvm.org/D22600 llvm-svn: 276673
* Sync up InstrProfData.inc with compiler-rt with fixes to referencesXinliang David Li2016-07-221-3/+3
| | | | llvm-svn: 276388
* Refactor indirect call promotion profitability analysis (NFC)Teresa Johnson2016-07-121-1/+1
| | | | | | | | | | | | | | | Summary: Refactored the profitability analysis out of the IC promotion pass and into lib/Analysis so that it can be accessed by the summary index builder in a follow-on patch to enable IC promotion in ThinLTO (D21932). Reviewers: davidxl, xur Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D22182 llvm-svn: 275216
* Fix PR28219: Use profile summary from reader and not compute itEaswaran Raman2016-06-211-4/+1
| | | | | | Differentiaal revision: http://reviews.llvm.org/D21546 llvm-svn: 273301
* Add a comment about why we need to buffer the attribute changes.Sean Silva2016-05-281-0/+3
| | | | llvm-svn: 271097
* Small cleanup.Sean Silva2016-05-281-6/+6
| | | | | | | Centralize assertion. Clean up max loop. llvm-svn: 271094
* Inline this into its only use. NFC.Sean Silva2016-05-281-10/+5
| | | | | | | The name was out of date at this point and it seems simple enough to have in-line. llvm-svn: 271093
* Bring back r271090 in a way that doesn't depend on r271089.Sean Silva2016-05-281-0/+1
| | | | llvm-svn: 271092
* Revert r271089 and r271090.Sean Silva2016-05-281-30/+43
| | | | | | | | | | | | | | It was triggering an msan bot. Revert "[IRPGO] Set the function entry count metadata." This reverts commit r271090. Revert "[IRPGO] Centralize the function attribute inliner hint logic. NFC." This reverts commit r271089. llvm-svn: 271091
* [IRPGO] Set the function entry count metadata.Sean Silva2016-05-281-0/+1
| | | | llvm-svn: 271090
OpenPOWER on IntegriCloud