summaryrefslogtreecommitdiff
path: root/test/Instrumentation
Commit message (Collapse)AuthorAge
* [msan] Handle mixed track-origins and keep-going settings (llvm part).Evgeniy Stepanov2013-05-31
| | | | | | | | | | | | | | | Before this change, each module defined a weak_odr global __msan_track_origins with a value of 1 if origin tracking is enabled, 0 if disabled. If there are modules with different values, any of them may win. If 0 wins, and there is at least one module with 1, the program will most likely crash. With this change, __msan_track_origins is only emitted if origin tracking is on. Then runtime library detects if there is at least one module with origin tracking, and enables runtime support for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182997 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix argument shadow alignment.Evgeniy Stepanov2013-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182771 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] A no-op implementation of VarArg handling.Evgeniy Stepanov2013-05-21
| | | | | | | | This stuff is used on platforms where MSan does not have a proper VarArg implementation (anything other than x86_64 at the moment). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182375 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Switch TLS globals to initial-exec model.Evgeniy Stepanov2013-05-16
| | | | | | | They are always defined in the main executable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181994 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing colons to check lines.Benjamin Kramer2013-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179277 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] make sure memset/memcpy/memmove are not inlined in tsan modeKostya Serebryany2013-03-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178230 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Adding DIImportedModules to DIScopes."David Blaikie2013-03-28
| | | | | | | | | This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178215 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding DIImportedModules to DIScopes.David Blaikie2013-03-27
| | | | | | | | | | | | This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178099 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix the testDmitry Vyukov2013-03-22
| | | | | | | | Add missed file from r177717 commit that adds __tsan_vptr_read. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177719 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: handle vptr loads speciallyDmitry Vyukov2013-03-22
| | | | | | | | | This is required to determine ctor/dtor vs virtual call races. http://llvm-reviews.chandlerc.com/D566 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177717 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm::removeUnreachableBlocks to handle unreachable loops.Evgeniy Stepanov2013-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177713 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field in DISubprogramDavid Blaikie2013-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177661 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] when creating string constants, set unnamed_attr and align 1 so that ↵Kostya Serebryany2013-03-18
| | | | | | equal strings are merged by the linker. Observed up to 1% binary size reduction. Thanks to Anton Korobeynikov for the suggestion git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177264 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] don't instrument functions with available_externally linkage. This ↵Kostya Serebryany2013-03-18
| | | | | | saves a bit of compile time and reduces the number of redundant global strings generated by asan (https://code.google.com/p/address-sanitizer/issues/detail?id=167) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177250 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out filename & directory from DIFile to start generalizing over DIScopesDavid Blaikie2013-03-17
| | | | | | | | | | This is the first step to making all DIScopes have a common metadata prefix (so that things (using directives, for example) that can appear in any scope can be added to that common prefix). DIFile is itself a DIScope so the common prefix of all DIScopes cannot be a DIFile - instead it's the raw filename/directory name pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177239 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] emit instrumentation for initialization order checking by defaultAlexey Samsonov2013-03-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177063 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the unused 4th operand for DIFile debug info metadataDavid Blaikie2013-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176983 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Implement sanitize_memory attribute.Evgeniy Stepanov2013-02-28
| | | | | | | | | | | Shadow checks are disabled and memory loads always produce fully initialized values in functions that don't have a sanitize_memory attribute. Value and argument shadow is propagated as usual. This change also updates blacklist behaviour to match the above. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176247 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify clang/llvm attributes for asan/tsan/msan (LLVM part)Kostya Serebryany2013-02-26
| | | | | | | | | | | | | | | | | | | | These are two related changes (one in llvm, one in clang). LLVM: - rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode) - rename thread_safety => sanitize_thread - rename no_uninitialized_checks -> sanitize_memory CLANG: - add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis)) - add __attribute__((no_sanitize_thread)) - add __attribute__((no_sanitize_memory)) for S in address thread memory If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not set llvm attribute sanitize_S git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176075 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] instrument invoke insns with noreturn attribute (as well as call insns)Kostya Serebryany2013-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175617 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] instrument memory accesses with unusual sizesKostya Serebryany2013-02-19
| | | | | | | | | | | | | | | | | | | This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or packed structures. Instrumentation is done with two 1-byte checks (first and last bytes) and if the error is found __asan_report_load_n(addr, real_size) or __asan_report_store_n(addr, real_size) is called. Also, call these two new functions in memset/memcpy instrumentation. asan-rt part will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175507 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] revert r175266 as it breaks code with packed structures. supporting ↵Kostya Serebryany2013-02-18
| | | | | | long double will require a more general solution git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175442 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] support long double on 64-bit. See ↵Kostya Serebryany2013-02-15
| | | | | | https://code.google.com/p/address-sanitizer/issues/detail?id=151 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175266 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] disable load widening in ThreadSanitizer modeKostya Serebryany2013-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175034 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix tests for the new ABIKostya Serebryany2013-02-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174959 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Mostly disable msan-handle-icmp-exact.Evgeniy Stepanov2013-01-28
| | | | | | | | | It is way too slow. Change the default option value to 0. Always do exact shadow propagation for unsigned ICmp with constants, it is cheap (under 1% cpu time) and required for correctness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173682 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Implement exact shadow propagation for relational ICmp.Evgeniy Stepanov2013-01-25
| | | | | | | | | Only for integers, pointers, and vectors of those. No floats. Instrumentation seems very heavy, and may need to be replaced with some approximation in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173452 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] adaptive redzones for globals (the larger the global the larger is ↵Kostya Serebryany2013-01-24
| | | | | | the redzone) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173335 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Do not insert check on volatile store.Evgeniy Stepanov2013-01-22
| | | | | | | Volatile bitfields can cause valid stores of uninitialized bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173153 91177308-0d34-0410-b5e6-96231b3b80d8
* ASan: wrap mapping scale and offset in a struct and make it a member of ASan ↵Alexey Samsonov2013-01-16
| | | | | | passes. Add test for non-default mapping scale and offset. No functionality change git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172610 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Temporarily remove ICmpEQ tests.Evgeniy Stepanov2013-01-15
| | | | | | | They are failing on the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172540 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of equality comparison of pointer vectors.Evgeniy Stepanov2013-01-15
| | | | | | | Also improve test coveration of the handling of relational comparisons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172539 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Change va_start/va_copy shadow memset alignment to 8.Peter Collingbourne2013-01-10
| | | | | | | | | This fixes va_start/va_copy of a va_list field which happens to not be laid out at a 16-byte boundary. Differential Revision: http://llvm-reviews.chandlerc.com/D276 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172128 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix lifetime intrinsics handling. Now for each intrinsic we check if ↵Alexey Samsonov2012-12-27
| | | | | | it describes one of 'interesting' allocas. Assume that allocas can go through casts and phi-nodes before apperaring as llvm.lifetime arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171153 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Raise alignment of origin stores/loads when possible.Evgeniy Stepanov2012-12-26
| | | | | | | | | Origin alignment is as high as the alignment of the corresponding application location, but never less than 4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171110 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of vectors of pointers.Evgeniy Stepanov2012-12-25
| | | | | | | | VectorType::getInteger() can not be used with them, because pointer size depends on the target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171070 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of select with vector condition.Evgeniy Stepanov2012-12-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171069 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Remove unreachable blocks before instrumenting a function.Evgeniy Stepanov2012-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170883 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Heuristically instrument unknown intrinsics.Evgeniy Stepanov2012-12-19
| | | | | | | | | | | | | This changes adds shadow and origin propagation for unknown intrinsics by examining the arguments and ModRef behaviour. For now, only 3 classes of intrinsics are handled: - those that look like simple SIMD store - those that look like simple SIMD load - those that don't have memory effects and look like arithmetic/logic/whatever operation on simple types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170530 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Origin stores and loads do not need explicit alignment.Evgeniy Stepanov2012-12-14
| | | | | | | Origin address is always 4 byte aligned, and the access type is always i32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170199 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve debug info generated with enabled AddressSanitizer.Alexey Samsonov2012-12-12
| | | | | | | | | | | | | When ASan replaces <alloca instruction> with <offset into a common large alloca>, it should also patch llvm.dbg.declare calls and replace debug info descriptors to mark that we've replaced alloca with a value that stores an address of the user variable, not the user variable itself. See PR11818 for more context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169984 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Do not store origin for clean values.Evgeniy Stepanov2012-12-06
| | | | | | | | | | | | | | | | | | | Instead of unconditionally storing origin with every application store, only do this when the shadow of the stored value is != 0. This change also delays instrumentation of stores until after the walk over function's instructions, because adding new basic blocks confuses InstVisitor. We only keep 1 origin value per 4 bytes of application memory. This change fixes the bug when a store of a single clean byte wiped the origin for the whole 4-byte area. Since stores of uninitialized values are relatively uncommon, this change improves performance of track-origins mode by 5% median and by up to 47% on specs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169490 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Instrument bswap intrinsic.Evgeniy Stepanov2012-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169383 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Change linkage type of __msan_track_origins.Evgeniy Stepanov2012-12-05
| | | | | | | | LinkOnceODRLinkage globals may be removed in GlobalOpt if not used in the current module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169377 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve MSan tests.Evgeniy Stepanov2012-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169256 91177308-0d34-0410-b5e6-96231b3b80d8
* ASan: add initial support for handling llvm.lifetime intrinsics in ASan - ↵Alexey Samsonov2012-12-04
| | | | | | emit calls into runtime library that poison memory for local variables when their lifetime is over and unpoison memory when their lifetime begins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169200 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Tests for vector manipulation instructions.Evgeniy Stepanov2012-11-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168997 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Propagate shadow through (x<0) and (x>=0) comparisons.Evgeniy Stepanov2012-11-29
| | | | | | | | This is a special case of signed relational comparison where result only depends on the sign of x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168881 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix shadow & origin store & load alignment.Evgeniy Stepanov2012-11-29
| | | | | | | | This change ensures that shadow memory accesses have the same alignment as corresponding app memory accesses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168880 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Add a test for r168873.Evgeniy Stepanov2012-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168877 91177308-0d34-0410-b5e6-96231b3b80d8