summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
Commit message (Collapse)AuthorAgeFilesLines
...
* msan: Stop stripping the 'tail' modifier off of callsReid Kleckner2014-06-301-6/+0
| | | | | | | This probably isn't necessary since msan started to unpoison the return value shadow memory before all calls. llvm-svn: 212061
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-263-11/+17
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-263-17/+11
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* [msan] Fix bad interaction between with-calls mode and chained origin tracking.Evgeniy Stepanov2014-06-251-1/+1
| | | | | | | | | | Origin history should only be recorded for uninitialized values, because it is meaningless otherwise. This change moves __msan_chain_origin to the runtime library side and makes it conditional on the corresponding shadow value. Previous code was correct, but _very_ inefficient. llvm-svn: 211700
* Add back functionality removed in r210497.Richard Trieu2014-06-211-2/+4
| | | | | | Instead of asserting, output a message stating that a null pointer was found. llvm-svn: 211430
* [msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.Evgeniy Stepanov2014-06-181-0/+55
| | | | llvm-svn: 211156
* [msan] Fix a comment.Evgeniy Stepanov2014-06-171-2/+2
| | | | llvm-svn: 211094
* [msan] Fix handling of multiplication by a constant with a number of ↵Evgeniy Stepanov2014-06-171-1/+49
| | | | | | | | | | | | | | | | | | | trailing zeroes. Multiplication by an integer with a number of trailing zero bits leaves the same number of lower bits of the result initialized to zero. This change makes MSan take this into account in the case of multiplication by a compile-time constant. We don't handle the general, non-constant, case because (a) it's not going to be cheap (computation-wise); (b) multiplication by a partially uninitialized value in user code is a bad idea anyway. Constant case must be handled because it appears from LLVM optimization of a completely valid user code, as the test case in compiler-rt demonstrates. llvm-svn: 211092
* Remove top-level Clang -fsanitize= flags for optional ASan features.Alexey Samsonov2014-06-131-33/+15
| | | | | | | | | | | | | Init-order and use-after-return modes can currently be enabled by runtime flags. use-after-scope mode is not really working at the moment. The only problem I see is that users won't be able to disable extra instrumentation for init-order and use-after-scope by a top-level Clang flag. But this instrumentation was implicitly enabled for quite a while and we didn't hear from users hurt by it. llvm-svn: 210924
* IR: add "cmpxchg weak" variant to support permitted failure.Tim Northover2014-06-131-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a weak variant of the cmpxchg operation, as described in C++11. A cmpxchg instruction with this modifier is permitted to fail to store, even if the comparison indicated it should. As a result, cmpxchg instructions must return a flag indicating success in addition to their original iN value loaded. Thus, for uniformity *all* cmpxchg instructions now return "{ iN, i1 }". The second flag is 1 when the store succeeded. At the DAG level, a new ATOMIC_CMP_SWAP_WITH_SUCCESS node has been added as the natural representation for the new cmpxchg instructions. It is a strong cmpxchg. By default this gets Expanded to the existing ATOMIC_CMP_SWAP during Legalization, so existing backends should see no change in behaviour. If they wish to deal with the enhanced node instead, they can call setOperationAction on it. Beware: as a node with 2 results, it cannot be selected from TableGen. Currently, no use is made of the extra information provided in this patch. Test updates are almost entirely adapting the input IR to the new scheme. Summary for out of tree users: ------------------------------ + Legacy Bitcode files are upgraded during read. + Legacy assembly IR files will be invalid. + Front-ends must adapt to different type for "cmpxchg". + Backends should be unaffected by default. llvm-svn: 210903
* Remove system_error.h.Rafael Espindola2014-06-121-1/+1
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Removing an "if (!this)" check from two print methods. The condition willRichard Trieu2014-06-091-0/+1
| | | | | | | never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210497
* [msan] Workaround for invalid origins in shufflevector.Evgeniy Stepanov2014-06-091-4/+8
| | | | | | | | | Makes origin propagation ignore literal undef operands, and, in general, any operand we don't have origin for. https://code.google.com/p/memory-sanitizer/issues/detail?id=56 llvm-svn: 210472
* [msan] Fix vector pack intrinsic handling.Evgeniy Stepanov2014-06-091-8/+72
| | | | | | | | | This fixes a crash on MMX intrinsics, as well as a corner case in handling of all unsigned pack intrinsics. PR19953. llvm-svn: 210454
* [asancov] Fix coverage line info some more.Evgeniy Stepanov2014-06-051-2/+4
| | | | | | | Now it should always point to the opening brace of the function (in -asan-coverage=1 mode). llvm-svn: 210266
* Fix coverage for files with global constructors again. Adds a testcase to ↵Nick Lewycky2014-06-051-0/+10
| | | | | | the commit from r206671, as requested by David Blaikie. llvm-svn: 210239
* Explain why we skip DbgInfoIntrinsics when looking at line numbers in .gcno ↵Nick Lewycky2014-06-041-0/+4
| | | | | | file emission. llvm-svn: 210218
* [asan] Fix coverage instrumentation with -asan-globals=0.Evgeniy Stepanov2014-06-031-25/+32
| | | | llvm-svn: 210103
* Ignore line numbers on debug intrinsics. Add an assert to ensure that we ↵Nick Lewycky2014-06-031-2/+4
| | | | | | aren't emitting line number zero, the .gcno format uses this to indicate that the next field is a filename. llvm-svn: 210068
* Remove sanitizer blacklist from ASan/TSan/MSan function passes.Alexey Samsonov2014-06-023-45/+14
| | | | | | | | | | | | | | | | | Instrumentation passes now use attributes address_safety/thread_safety/memory_safety which are added by Clang frontend. Clang parses the blacklist file and adds the attributes accordingly. Currently blacklist is still used in ASan module pass to disable instrumentation for certain global variables. We should fix this as well by collecting the set of globals we're going to instrument in Clang and passing it to ASan in metadata (as we already do for dynamically-initialized globals and init-order checking). This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline flags in favor of -fsanitize-blacklist= Clang flag. llvm-svn: 210038
* [msan] Remove an out-of-date comment.Evgeniy Stepanov2014-06-021-2/+0
| | | | | | MSan is no longer an "early prototype". llvm-svn: 210023
* [msan] Handle x86 vector pack intrinsics.Evgeniy Stepanov2014-06-021-0/+36
| | | | llvm-svn: 210020
* [ASan] Behave the same for functions w/o sanitize_address attribute and ↵Alexey Samsonov2014-05-311-2/+1
| | | | | | blacklisted functions llvm-svn: 209946
* [TSan] Behave the same for functions w/o sanitize_thread attribute and ↵Alexey Samsonov2014-05-311-5/+7
| | | | | | blacklisted functions llvm-svn: 209939
* Use range-based for loops in ASan, TSan and MSanAlexey Samsonov2014-05-293-97/+81
| | | | llvm-svn: 209834
* [ASan] Hoist blacklisting globals from init-order checking to Clang.Alexey Samsonov2014-05-291-2/+0
| | | | | | | | | Clang knows about the sanitizer blacklist and it makes no sense to add global to the list of llvm.asan.dynamically_initialized_globals if it will be blacklisted in the instrumentation pass anyway. Instead, we should do as much blacklisting as possible (if not all) in the frontend. llvm-svn: 209790
* Fix typo in variable nameAlexey Samsonov2014-05-291-3/+3
| | | | llvm-svn: 209784
* [ASan] Use llvm.global_ctors to insert init-order checking calls into ASan ↵Alexey Samsonov2014-05-291-34/+23
| | | | | | | | | | | | runtime. Don't assume that dynamically initialized globals are all initialized from _GLOBAL__<module_name>I_ function. Instead, scan the llvm.global_ctors and insert poison/unpoison calls to each function there. Patch by Nico Weber! llvm-svn: 209780
* [asancov] Don't emit extra runtime calls when compiling without coverage.Evgeniy Stepanov2014-05-281-3/+5
| | | | llvm-svn: 209721
* [asancov] Emit an initializer passing number of coverage code locations in ↵Evgeniy Stepanov2014-05-271-4/+14
| | | | | | each module. llvm-svn: 209654
* [asan] decrease asan-instrumentation-with-call-threshold from 10000 to 7000, ↵Kostya Serebryany2014-05-261-1/+1
| | | | | | see PR17409 llvm-svn: 209623
* [asan] properly instrument memory accesses that have small alignment ↵Kostya Serebryany2014-05-231-9/+19
| | | | | | (smaller than min(8,size)) by making two checks instead of one. This may slowdown some cases, e.g. long long on 32-bit or wide loads produced after loop unrolling. The benefit is higher sencitivity. llvm-svn: 209508
* Delete getAliasedGlobal.Rafael Espindola2014-05-161-1/+1
| | | | llvm-svn: 209040
* [asan] Fix compiler warnings.Evgeniy Stepanov2014-05-141-5/+3
| | | | llvm-svn: 208769
* [asan] Set debug location in ASan function prologue.Evgeniy Stepanov2014-05-141-2/+14
| | | | | | | | | Most importantly, it gives debug location info to the coverage callback. This change also removes 2 cases of unnecessary setDebugLoc when IRBuilder is created with the same debug location. llvm-svn: 208767
* [msan] Fix -fsanitize=memory -fno-integrated-as.Evgeniy Stepanov2014-05-071-1/+1
| | | | llvm-svn: 208211
* Fix ASan init function detection after clang r208128.Nico Weber2014-05-061-3/+24
| | | | llvm-svn: 208141
* [ASan/Win] Fix issue 305 -- don't instrument .CRT initializer/terminator ↵Timur Iskhodzhanov2014-05-051-4/+14
| | | | | | | | | callbacks See https://code.google.com/p/address-sanitizer/issues/detail?id=305 Reviewed at http://reviews.llvm.org/D3607 llvm-svn: 207968
* [C++] Use 'nullptr'.Craig Topper2014-04-281-1/+1
| | | | llvm-svn: 207394
* [C++] Use 'nullptr'. Transforms edition.Craig Topper2014-04-257-74/+79
| | | | llvm-svn: 207196
* [ASan] Move the shadow range on 32-bit iOS (and iOS Simulator)Alexander Potapenko2014-04-231-1/+4
| | | | | | | | to 0x40000000-0x60000000 to avoid address space clash with system libraries. The solution has been proposed by tahabekireren@gmail.com in https://code.google.com/p/address-sanitizer/issues/detail?id=210 This is also known to fix some Chromium iOS tests. llvm-svn: 207002
* Fix handling of missing DataLayout in sanitizers.Evgeniy Stepanov2014-04-234-4/+4
| | | | | | | Pass::doInitialization is supposed to return False when it did not change the program, not when a fatal error occurs. llvm-svn: 206975
* [asan] Support outline instrumentation for wide types and delete dead code, ↵Kostya Serebryany2014-04-221-27/+12
| | | | | | patch by Yuri Gribov llvm-svn: 206883
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-226-11/+12
| | | | | | | | | | | | | | | | | definition below all of the header #include lines, lib/Transforms/... edition. This one is tricky for two reasons. We again have a couple of passes that define something else before the includes as well. I've sunk their name macros with the DEBUG_TYPE. Also, InstCombine contains headers that need DEBUG_TYPE, so now those headers #define and #undef DEBUG_TYPE around their code, leaving them well formed modular headers. Fixing these headers was a large motivation for all of these changes, as "leaky" macros of this form are hard on the modules implementation. llvm-svn: 206844
* Use unique_ptr to handle ownership of GCOVFunctions in GCOVProfiler.David Blaikie2014-04-211-14/+10
| | | | llvm-svn: 206786
* [msan] Enable out-of-line instrumentation for large functions by default.Evgeniy Stepanov2014-04-211-1/+1
| | | | llvm-svn: 206759
* [asan] add a run-time flag detect_container_overflow=true/falseKostya Serebryany2014-04-211-1/+1
| | | | llvm-svn: 206756
* [asan] instead of inserting inline instrumentation around ↵Kostya Serebryany2014-04-211-29/+33
| | | | | | memset/memcpy/memmove, replace the intrinsic with __asan_memset/etc. This makes the memset/etc handling more complete and consistent with what we do in msan. It may slowdown some cases (when the intrinsic was actually inlined) and speedup other cases (when it was not inlined) llvm-svn: 206746
* [asan] temporary disable generating __asan_loadN/__asan_storeNKostya Serebryany2014-04-211-11/+6
| | | | llvm-svn: 206741
* [asan] insert __asan_loadN/__asan_storeN as out-lined asan checks, llvm partKostya Serebryany2014-04-211-3/+15
| | | | llvm-svn: 206734
OpenPOWER on IntegriCloud