summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
Commit message (Collapse)AuthorAgeFilesLines
...
* [EfficiencySanitizer] Using '$' instead of '#' for struct counter nameSagar Thakur2016-09-221-6/+6
| | | | | | | | | For MIPS '#' is the start of comment line. Therefore we get assembler errors if # is used in the structure names. Differential: D24334 Reviewed by: zhaoqin llvm-svn: 282141
* revert 281908 because 281909 got revertedNico Weber2016-09-211-46/+7
| | | | llvm-svn: 282097
* 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
* [Profile] code refactoring: make getStep a method in base classXinliang David Li2016-09-201-9/+1
| | | | llvm-svn: 282002
* ASAN: Don't drop debug info attachements for global variables.Adrian Prantl2016-09-201-0/+7
| | | | | | | | | | This is a follow-up to r281284. Global Variables now can have !dbg attachements, so ASAN should clone these when generating a sanitized copy of a global variable. <rdar://problem/24899262> llvm-svn: 281994
* [sanitizer-coverage] add comdat to coverage guards if neededKostya Serebryany2016-09-201-0/+2
| | | | llvm-svn: 281952
* [asan] Support dynamic shadow address instrumentationEtienne Bergeron2016-09-191-7/+46
| | | | | | | | | | | | | | | | | | | Summary: This patch is adding the support for a shadow memory with dynamically allocated address range. The compiler-rt needs to export a symbol containing the shadow memory range. This is required to support ASAN on windows 64-bits. Reviewers: kcc, rnk, vitalybuka Subscribers: kubabrecka, dberris, llvm-commits, chrisha Differential Revision: https://reviews.llvm.org/D23354 llvm-svn: 281908
* 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-182-11/+151
| | | | | | Differential Revision: http://reviews.llvm.org/D23727 llvm-svn: 281858
* [libFuzzer] use 'if guard' instead of 'if guard >= 0' with trace-pc; change ↵Kostya Serebryany2016-09-181-7/+9
| | | | | | the guard type to intptr_t; use separate array for 8-bit counters llvm-svn: 281845
* [sanitizer-coverage] change trace-pc to use 8-byte guardsKostya Serebryany2016-09-171-24/+27
| | | | llvm-svn: 281809
* Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous ↵Vitaly Buka2016-09-161-75/+0
| | | | | | | | | | state" This approach is not good enough. Working on the new solution. This reverts commit r280907. llvm-svn: 281689
* Revert "[asan] Add flag to allow lifetime analysis of problematic allocas"Vitaly Buka2016-09-161-6/+0
| | | | | | | | This approach is not good enough. Working on the new solution. This reverts commit r281126. llvm-svn: 281688
* [sanitizer-coverage] make trace-pc-guard and indirect-call work togetherKostya Serebryany2016-09-151-1/+1
| | | | llvm-svn: 281665
* [compiler-rt] Changing function prototype returning unused valueEtienne Bergeron2016-09-151-5/+10
| | | | | | | | | | | | Summary: The return value of `maybeInsertAsanInitAtFunctionEntry` is ignored. Reviewers: rnk Subscribers: llvm-commits, chrisha, dberris Differential Revision: https://reviews.llvm.org/D24568 llvm-svn: 281620
* Fix silly mistake introduced here : https://reviews.llvm.org/D24566Etienne Bergeron2016-09-151-1/+1
| | | | | | Asan bots are currently broken without this patch. llvm-svn: 281618
* address comments from: https://reviews.llvm.org/D24566Etienne Bergeron2016-09-151-1/+1
| | | | | | using startswith instead of find. llvm-svn: 281617
* [compiler-rt] Avoid instrumenting sanitizer functionsEtienne Bergeron2016-09-141-6/+10
| | | | | | | | | | | | | | | | | | | Summary: Function __asan_default_options is called by __asan_init before the shadow memory got initialized. Instrumenting that function may lead to flaky execution. As the __asan_default_options is provided by users, we cannot expect them to add the appropriate function atttributes to avoid instrumentation. Reviewers: kcc, rnk Subscribers: dberris, chrisha, llvm-commits Differential Revision: https://reviews.llvm.org/D24566 llvm-svn: 281503
* Fix typo in comment [NFC]Etienne Bergeron2016-09-141-1/+1
| | | | llvm-svn: 281492
* [asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR ↵Kuba Brecka2016-09-141-1/+2
| | | | | | | | | | false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 llvm-svn: 281470
* [sanitizer-coverage] add yet another flavour of coverage instrumentation: ↵Kostya Serebryany2016-09-141-2/+52
| | | | | | trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part llvm-svn: 281431
* [asan] Add flag to allow lifetime analysis of problematic allocasVitaly Buka2016-09-101-0/+6
| | | | | | | | | | | | | | Summary: Could be useful for comparison when we suspect that alloca was skipped because of this. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24437 llvm-svn: 281126
* [asan] Avoid lifetime analysis for allocas with can be in ambiguous stateVitaly Buka2016-09-081-0/+75
| | | | | | | | | | | | | | | | | | Summary: C allows to jump over variables declaration so lifetime.start can be avoid before variable usage. To avoid false-positives on such rare cases we detect them and remove from lifetime analysis. PR27453 PR28267 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24321 llvm-svn: 280907
* Revert "[asan] Avoid lifetime analysis for allocas with can be in ambiguous ↵Vitaly Buka2016-09-071-74/+0
| | | | | | | | | | state" Fails on Windows. This reverts commit r280880. llvm-svn: 280883
* [asan] Avoid lifetime analysis for allocas with can be in ambiguous stateVitaly Buka2016-09-071-0/+74
| | | | | | | | | | | | | | | | | | Summary: C allows to jump over variables declaration so lifetime.start can be avoid before variable usage. To avoid false-positives on such rare cases we detect them and remove from lifetime analysis. PR27453 PR28267 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24321 llvm-svn: 280880
* Revert "[EfficiencySanitizer] Adds shadow memory parameters for 40-bit ↵Renato Golin2016-09-071-34/+9
| | | | | | | | | | | virtual memory address." This reverts commit r280796, as it broke the AArch64 bots for no reason. The tests were passing and we should try to keep them passing, so a proper review should make that happen. llvm-svn: 280802
* [EfficiencySanitizer] Adds shadow memory parameters for 40-bit virtual ↵Sagar Thakur2016-09-071-9/+34
| | | | | | | | | | | memory address. Adding 40-bit shadow memory parameters because MIPS64 uses 40-bit virtual memory addresses. Reviewed by bruening Differential: D23801 llvm-svn: 280796
* Add cast to appease windows builder. Fixes build break introduced in r280306.Nick Lewycky2016-08-311-1/+1
| | | | llvm-svn: 280311
* Add -fprofile-dir= to clang.Nick Lewycky2016-08-311-13/+30
| | | | | | | | | | | | | | | | | | | | | -fprofile-dir=path allows the user to specify where .gcda files should be emitted when the program is run. In particular, this is the first flag that causes the .gcno and .o files to have different paths, LLVM is extended to support this. -fprofile-dir= does not change the file name in the .gcno (and thus where lcov looks for the source) but it does change the name in the .gcda (and thus where the runtime library writes the .gcda file). It's different from a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX. To implement this we split -coverage-file into -coverage-data-file and -coverage-notes-file to specify the two different names. The !llvm.gcov metadata node grows from a 2-element form {string coverage-file, node dbg.cu} to 3-elements, {string coverage-notes-file, string coverage-data-file, node dbg.cu}. In the 3-element form, the file name is already "mangled" with .gcno/.gcda suffixes, while the 2-element form left that to the middle end pass. llvm-svn: 280306
* [sanitizer-coverage] add two more modes of instrumentation: trace-div and ↵Kostya Serebryany2016-08-301-6/+75
| | | | | | trace-gep, mostly usaful for value-profile-based fuzzing; llvm part llvm-svn: 280043
* [asan] Enable new stack poisoning with store instruction by defaultVitaly Buka2016-08-291-1/+1
| | | | | | | | | | Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23968 llvm-svn: 279993
* Use store operation to poison allocas for lifetime analysis.Vitaly Buka2016-08-291-59/+106
| | | | | | | | | | | | | | | | | | Summary: Calling __asan_poison_stack_memory and __asan_unpoison_stack_memory for small variables is too expensive. Code is disabled by default and can be enabled by -asan-experimental-poisoning. PR27453 Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23947 llvm-svn: 279984
* [asan] Separate calculation of ShadowBytes from calculating ASanStackFrameLayoutVitaly Buka2016-08-291-4/+6
| | | | | | | | | | | | Summary: No functional changes, just refactoring to make D23947 simpler. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23954 llvm-svn: 279982
* [asan] Use 1 byte aligned stores to poison shadow memoryVitaly Buka2016-08-221-2/+2
| | | | | | | | | | | | Summary: r279379 introduced crash on arm 32bit bot. I suspect this is alignment issue. Reviewers: eugenis Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D23762 llvm-svn: 279413
* [asan] Minimize code size by using __asan_set_shadow_* for large blocksVitaly Buka2016-08-201-5/+48
| | | | | | | | | | | | | Summary: We can insert function call instead of multiple store operation. Current default is blocks larger than 64 bytes. Changes are hidden behind -asan-experimental-poisoning flag. PR27453 Differential Revision: https://reviews.llvm.org/D23711 llvm-svn: 279383
* [asan] Initialize __asan_set_shadow_* callbacksVitaly Buka2016-08-201-0/+19
| | | | | | | | | | | | | | | Summary: Callbacks are not being used yet. PR27453 Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23634 llvm-svn: 279380
* [asan] Optimize store size in FunctionStackPoisoner::poisonRedZonesVitaly Buka2016-08-201-47/+60
| | | | | | | | | | | | Summary: Reduce store size to avoid leading and trailing zeros. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23648 llvm-svn: 279379
* [asan] Cleanup instrumentation of dynamic allocasVitaly Buka2016-08-201-24/+44
| | | | | | | | | | Summary: Extract instrumenting dynamic allocas into separate method. Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas Differential Revision: https://reviews.llvm.org/D23707 llvm-svn: 279376
* [asan] Add support of lifetime poisoning into ComputeASanStackFrameLayoutVitaly Buka2016-08-201-1/+4
| | | | | | | | | | | | | | | Summary: We are going to combine poisoning of red zones and scope poisoning. PR27453 Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23623 llvm-svn: 279373
* Revert "[asan] Add support of lifetime poisoning into ↵Vitaly Buka2016-08-191-4/+1
| | | | | | | | | | ComputeASanStackFrameLayout" This reverts commit r279020. Speculative revert in hope to fix asan test on arm. llvm-svn: 279332
* Revert "[asan] Optimize store size in FunctionStackPoisoner::poisonRedZones"Vitaly Buka2016-08-191-55/+40
| | | | | | | | This reverts commit r279178. Speculative revert in hope to fix asan crash on arm. llvm-svn: 279277
* Revert "[asan] Fix size of shadow incorrectly calculated in r279178"Vitaly Buka2016-08-191-2/+4
| | | | | | | | This reverts commit r279222. Speculative revert in hope to fix asan crash on arm. llvm-svn: 279276
* [asan] Fix size of shadow incorrectly calculated in r279178Vitaly Buka2016-08-191-4/+2
| | | | | | | | | | | | Summary: r279178 generates 8 times more stores than necessary. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23708 llvm-svn: 279222
* [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
* [asan] Optimize store size in FunctionStackPoisoner::poisonRedZonesVitaly Buka2016-08-181-40/+55
| | | | | | | | | | | | Summary: Reduce store size to avoid leading and trailing zeros. Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23648 llvm-svn: 279178
* [sanitizer-coverage/libFuzzer] instrument comparisons with ↵Kostya Serebryany2016-08-181-8/+24
| | | | | | __sanitizer_cov_trace_cmp[1248] instead of __sanitizer_cov_trace_cmp, don't pass the comparison type to save a bit performance. Use these new callbacks in libFuzzer llvm-svn: 279027
* [asan] Add support of lifetime poisoning into ComputeASanStackFrameLayoutVitaly Buka2016-08-181-1/+4
| | | | | | | | | | | | | | | Summary: We are going to combine poisoning of red zones and scope poisoning. PR27453 Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23623 llvm-svn: 279020
OpenPOWER on IntegriCloud