summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | | This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
* [Asan] Unpoison red zones even if use-after-scope was disabled with runtime flagVitaly Buka2016-08-161-2/+3
| | | | | | | | | | | | Summary: PR27453 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23481 llvm-svn: 278818
* [MemorySanitizer] [MIPS] Changed memory mapping to support pie executable.Sagar Thakur2016-08-161-2/+2
| | | | | | | Reviewed by eugenis Differential: D22994 llvm-svn: 278795
* Fix some Clang-tidy modernize and Include What You Use warnings.Eugene Zelenko2016-08-111-12/+22
| | | | | | Differential revision: https://reviews.llvm.org/D23291 llvm-svn: 278364
* [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-094-5/+5
| | | | | | | | | | | 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
* [asan] Add const into few methodsVitaly Buka2016-07-281-10/+10
| | | | | | | | | | | | Summary: No functional changes Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22899 llvm-svn: 277069
* [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
* Unpoison stack before resume instructionVitaly Buka2016-07-221-0/+6
| | | | | | | | | | | | | | | | | | | Summary: Clang inserts cleanup code before resume similar way as before return instruction. This makes asan poison local variables causing false use-after-scope reports. __asan_handle_no_return does not help here as it was executed before llvm.lifetime.end inserted into resume block. To avoid false report we need to unpoison stack for resume same way as for return. PR27453 Reviewers: kcc, eugenis Differential Revision: https://reviews.llvm.org/D22661 llvm-svn: 276480
* Sync up InstrProfData.inc with compiler-rt with fixes to referencesXinliang David Li2016-07-221-3/+3
| | | | llvm-svn: 276388
* Fix detection of stack-use-after scope for char arrays.Vitaly Buka2016-07-221-0/+4
| | | | | | | | | | | | | | Summary: Clang inserts GetElementPtrInst so findAllocaForValue was not able to find allocas. PR27453 Reviewers: kcc, eugenis Differential Revision: https://reviews.llvm.org/D22657 llvm-svn: 276374
* [Profile] deprecate __llvm_profile_override_default_filenameXinliang David Li2016-07-211-16/+16
| | | | | | | | This eliminates unncessary calls and init functions. Differential Revision: http://reviews.llvm.org/D22613 llvm-svn: 276354
* [PGO] Make needsComdatForCounter() available (NFC)Rong Xu2016-07-211-27/+0
| | | | | | | | | | Move needsComdatForCounter() to lib/ProfileData/InstrProf.cpp from lib/Transforms/Instrumentation/InstrProfiling.cpp to make is available for other files. Differential Revision: https://reviews.llvm.org/D22643 llvm-svn: 276330
* Avoid a string copy, NFCVedant Kumar2016-07-211-1/+1
| | | | llvm-svn: 276310
* Rename StringMap::emplace_second to try_emplace.Benjamin Kramer2016-07-211-1/+1
| | | | | | | Coincidentally this function maps to the C++17 try_emplace. Rename it for consistentcy with C++17 std::map. NFC. llvm-svn: 276276
* [GCOV] Remove a layer of indirection.Benjamin Kramer2016-07-211-18/+10
| | | | | | | StringMap is designed to hold large values. No functionality change intended. llvm-svn: 276265
* [tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda*Vedant Kumar2016-07-191-2/+3
| | | | | | | | | | r274801 did not go far enough to allow gcov+tsan to cooperate. With this commit it's possible to run the following code without false positives: std::thread T1(fib), T2(fib); T1.join(); T2.join(); llvm-svn: 276015
* Address review comments.Teresa Johnson2016-07-171-0/+8
| | | | llvm-svn: 275706
* Refactor indirect call promotion profitability analysis (NFC)Teresa Johnson2016-07-171-8/+0
| | | | | | | | | | | | | | | 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: 275705
* [sanitizer-coverage] make sure that calls to __sanitizer_cov_trace_pc are ↵Kostya Serebryany2016-07-141-1/+2
| | | | | | not merged (otherwise different calls get the same PC and confuse fuzzers) llvm-svn: 275449
* Remove unused variable to fix bot failure from r275216Teresa Johnson2016-07-121-2/+1
| | | | | | | Remove unused variable added in r275216. Should fix bot failure: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/24665 llvm-svn: 275219
* Refactor indirect call promotion profitability analysis (NFC)Teresa Johnson2016-07-123-105/+22
| | | | | | | | | | | | | | | 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
* [tsan] Try harder to not instrument gcov countersVedant Kumar2016-07-071-2/+2
| | | | | | | | GCOVProfiler::emitProfileArcs() can create many variables with names starting with "__llvm_gcov_ctr", so llvm appends a numeric suffix to most of them. Teach tsan about this. llvm-svn: 274801
* [esan:cfrag] Add option -esan-aux-field-infoQin Zhao2016-07-071-44/+66
| | | | | | | | | | | | | | | | | | | Summary: Adds option -esan-aux-field-info to control generating binary with auxiliary struct field information. Extracts code for creating auxiliary information from createCacheFragInfoGV into createCacheFragAuxGV. Adds test struct_field_small.ll for -esan-aux-field-info test. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D22019 llvm-svn: 274726
* [esan|wset] Fix incorrect memory size assertDerek Bruening2016-07-061-2/+2
| | | | | | | | | | | | | | Summary: Fixes an incorrect assert that fails on 128-bit-sized loads or stores. Augments the wset tests to include this case. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D22062 llvm-svn: 274666
* [asan] Add a hidden option for Mach-O global metadata liveness trackingRyan Govostes2016-07-051-0/+10
| | | | llvm-svn: 274578
* Use arrays or initializer lists to feed ArrayRefs instead of SmallVector ↵Benjamin Kramer2016-07-021-5/+2
| | | | | | | | where possible. No functionality change intended. llvm-svn: 274431
* [esan|cfrag] Add counters for struct array accessesQin Zhao2016-07-021-34/+87
| | | | | | | | | | | | | | | | | Summary: Adds one counter to the struct counter array for counting struct array accesses. Adds instrumentation to insert counter update for struct array accesses. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D21594 llvm-svn: 274420
* [msan] Fix __msan_maybe_ for non-standard type sizes.Evgeniy Stepanov2016-07-011-1/+1
| | | | | | | | | | | Fix incorrect calculation of the type size for __msan_maybe_warning_N call that resulted in an invalid (narrowing) zext instruction and "Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed." Only happens in very large functions (with more than 3500 MSan checks) operating on integer types that are not power-of-two. llvm-svn: 274395
* [asan] fix false dynamic-stack-buffer-overflow report with constantly-sized ↵Kuba Brecka2016-06-271-9/+10
| | | | | | | | | | dynamic allocas, LLVM part See the bug report at https://github.com/google/sanitizers/issues/691. When a dynamic alloca has a constant size, ASan instrumentation will treat it as a regular dynamic alloca (insert calls to poison and unpoison), but the backend will turn it into a regular stack variable. The poisoning/unpoisoning is then broken. This patch will treat such allocas as static. Differential Revision: http://reviews.llvm.org/D21509 llvm-svn: 273888
* [msan] Tighten up type in StoreList. NFC.Benjamin Kramer2016-06-271-13/+13
| | | | llvm-svn: 273866
* Apply clang-tidy's modernize-loop-convert to most of lib/Transforms.Benjamin Kramer2016-06-264-37/+25
| | | | | | Only minor manual fixes. No functionality change intended. llvm-svn: 273808
* Switch more loops to be range-basedDavid Majnemer2016-06-241-3/+1
| | | | | | | This makes the code a little more concise, no functional change is intended. llvm-svn: 273644
* [asan] Do not instrument accesses to profiling globalsVedant Kumar2016-06-221-5/+14
| | | | | | | | | | | | | It's only useful to asan-itize profiling globals while debugging llvm's profiling instrumentation passes. Enabling asan along with instrprof or gcov instrumentation shouldn't incur extra overhead. This patch is in the same spirit as r264805 and r273202, which disabled tsan instrumentation of instrprof/gcov globals. Differential Revision: http://reviews.llvm.org/D21541 llvm-svn: 273444
* Delete more dead code.Rafael Espindola2016-06-221-12/+0
| | | | | | Found by gcc 6. llvm-svn: 273402
* [asan] Do not instrument pointers with address space attributesAnna Zaks2016-06-222-0/+17
| | | | | | | | | Do not instrument pointers with address space attributes since we cannot track them anyway. Instrumenting them results in false positives in ASan and a compiler crash in TSan. (The compiler should not crash in any case, but that's a different problem.) llvm-svn: 273339
* 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
* This is part of the effort for asan to support Windows 64 bit.Etienne Bergeron2016-06-211-0/+4
| | | | | | | | | | The large offset is being tested on Windows 10 (which has larger usable virtual address space than Windows 8 or earlier) Patch by: Wei Wang Differential Revision: http://reviews.llvm.org/D21523 llvm-svn: 273269
* clang format change /NFCXinliang David Li2016-06-211-28/+34
| | | | llvm-svn: 273233
* [tsan] Do not instrument accesses to the gcov counters arrayVedant Kumar2016-06-201-0/+4
| | | | | | | | There is a known intended race here. This is a follow-up to r264805, which disabled tsan instrumentation for updates to instrprof counters. For more background on this please see the discussion in D18164. llvm-svn: 273202
* [sanitizers] Disable target-specific lowering of string functions.Marcin Koscielnicki2016-06-184-8/+54
| | | | | | | | | | | | CodeGen has hooks that allow targets to emit specialized code instead of calls to memcmp, memchr, strcpy, stpcpy, strcmp, strlen, strnlen. When ASan/MSan/TSan/ESan is in use, this sidesteps its interceptors, resulting in uninstrumented memory accesses. To avoid that, make these sanitizers mark the calls as nobuiltin. Differential Revision: http://reviews.llvm.org/D19781 llvm-svn: 273083
* [esan|cfrag] Add the struct field size array in StructInfoQin Zhao2016-06-171-2/+13
| | | | | | | | | | | | | | | Summary: Adds the struct field size array in struct StructInfo. Updates test struct_field_count_basic.ll. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits Differential Revision: http://reviews.llvm.org/D21341 llvm-svn: 272989
* IR: Introduce local_unnamed_addr attribute.Peter Collingbourne2016-06-144-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a local_unnamed_addr attribute is attached to a global, the address is known to be insignificant within the module. It is distinct from the existing unnamed_addr attribute in that it only describes a local property of the module rather than a global property of the symbol. This attribute is intended to be used by the code generator and LTO to allow the linker to decide whether the global needs to be in the symbol table. It is possible to exclude a global from the symbol table if three things are true: - This attribute is present on every instance of the global (which means that the normal rule that the global must have a unique address can be broken without being observable by the program by performing comparisons against the global's address) - The global has linkonce_odr linkage (which means that each linkage unit must have its own copy of the global if it requires one, and the copy in each linkage unit must be the same) - It is a constant or a function (which means that the program cannot observe that the unique-address rule has been broken by writing to the global) Although this attribute could in principle be computed from the module contents, LTO clients (i.e. linkers) will normally need to be able to compute this property as part of symbol resolution, and it would be inefficient to materialize every module just to compute it. See: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160509/356401.html http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160516/356738.html for earlier discussion. Part of the fix for PR27553. Differential Revision: http://reviews.llvm.org/D20348 llvm-svn: 272709
* [esan|cfrag] Handle complex GEP instr in the cfrag toolQin Zhao2016-06-101-35/+42
| | | | | | | | | | | | | | | | Summary: Iterates all (except the first and the last) operands within each GEP instruction for instrumentation. Adds test struct_field_gep.ll. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, bruening, llvm-commits Differential Revision: http://reviews.llvm.org/D21242 llvm-svn: 272442
* [esan|cfrag] Add the struct field offset array in StructInfoQin Zhao2016-06-101-11/+29
| | | | | | | | | | | | | | | Summary: Adds the struct field offset array in struct StructInfo. Updates test struct_field_count_basic.ll. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D21192 llvm-svn: 272362
* [esan|cfrag] Disable load/store instrumentation for cfragQin Zhao2016-06-101-3/+7
| | | | | | | | | | | | | | | | | | | | Summary: Adds ClInstrumentFastpath option to control fastpath instrumentation. Avoids the load/store instrumentation for the cache fragmentation tool. Renames cache_frag_basic.ll to working_set_slow.ll for slowpath instrumentation test. Adds the __esan_init check in struct_field_count_basic.ll. Reviewers: aizatsky Subscribers: llvm-commits, bruening, eugenis, kcc, zhaoqin, vitalybuka Differential Revision: http://reviews.llvm.org/D21079 llvm-svn: 272355
* Make sure that not interesting allocas are not instrumented.Vitaly Buka2016-06-091-4/+13
| | | | | | | | | | | | | | | | | | | Summary: We failed to unpoison uninteresting allocas on return as unpoisoning is part of main instrumentation which skips such allocas. Added check -asan-instrument-allocas for dynamic allocas. If instrumentation of dynamic allocas is disabled it will not will not be unpoisoned. PR27453 Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21207 llvm-svn: 272341
* Unpoison stack memory in use-after-return + use-after-scope modeVitaly Buka2016-06-091-12/+21
| | | | | | | | | | | | | | | Summary: We still want to unpoison full stack even in use-after-return as it can be disabled at runtime. PR27453 Reviewers: eugenis, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21202 llvm-svn: 272334
OpenPOWER on IntegriCloud