summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation
Commit message (Collapse)AuthorAge
* [tsan] fix instrumentation of vector vptr updates ↵Kostya Serebryany2013-12-02
| | | | | | (https://code.google.com/p/thread-sanitizer/issues/detail?id=43) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196079 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Split entry blocks in GCNOProfiling.cpp.Yuchen Wu2013-11-22
| | | | | | | | | | | | | gcov expects every function to contain an entry block that unconditionally branches into the next block. clang does not implement basic blocks in this manner, so gcov did not output correct branch info if the entry block branched to multiple blocks. This change splits every function's entry block into an empty block and a block with the rest of the instructions. The instrumentation code will take care of the rest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195513 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce two command-line flags for the instrumentation pass to control ↵Peter Collingbourne2013-11-21
| | | | | | | | | | | | | | whether the labels of pointers should be ignored in load and store instructions The new command line flags are -dfsan-ignore-pointer-label-on-store and -dfsan-ignore-pointer-label-on-load. Their default value matches the current labelling scheme. Additionally, the function __dfsan_union_load is marked as readonly. Patch by Lorenzo Martignoni! Differential Revision: http://llvm-reviews.chandlerc.com/D2187 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195382 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Propagate condition origin in select instruction.Evgeniy Stepanov2013-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195349 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Don't assume FileChecksum was generated.Yuchen Wu2013-11-21
| | | | | | | For cases where emitProfileArcs() was called but emitProfileNotes() was not, set the CfgChecksum to 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195311 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Fixed some bugs related to file checksum.Yuchen Wu2013-11-21
| | | | | | | Added call to update CfgChecksum. Made FileChecksum a vector, separate for each source file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195309 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added file checksum to gcno and gcda files.Yuchen Wu2013-11-20
| | | | | | | | | | | | Instead of permanently outputting "MVLL" as the file checksum, clang will create gcno and gcda checksums by hashing the destination block numbers of every arc. This allows for llvm-cov to check if the two gcov files are synchronized. Regenerated the test files so they contain the checksum. Also added negative test to ensure error when the checksums don't match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195191 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix PR17867 - make sure ASan doesn't crash if use-after-scope and ↵Alexey Samsonov2013-11-18
| | | | | | use-after-return are combined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195014 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] use GlobalValue::PrivateLinkage for coverage guard to save quite a ↵Kostya Serebryany2013-11-15
| | | | | | bit of code size git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194800 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "[asan] Poor man's coverage that works with ASan"Bob Wilson2013-11-15
| | | | | | | | I was able to successfully run a bootstrapped LTO build of clang with r194701, so this change does not seem to be the cause of our failing buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194789 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[asan] Poor man's coverage that works with ASan"Bob Wilson2013-11-15
| | | | | | | | | This reverts commit 194701. Apple's bootstrapped LTO builds have been failing, and this change (along with compiler-rt 194702-194704) is the only thing on the blamelist. I will either reappy these changes or help debug the problem, depending on whether this fixes the buildbots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194780 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Poor man's coverage that works with ASanKostya Serebryany2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194701 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fast path optimization for wrap-indirect-calls feature of ↵Evgeniy Stepanov2013-11-14
| | | | | | | | | | | | | | | | | | | | MemorySanitizer. Indirect call wrapping helps MSanDR (dynamic instrumentation companion tool for MSan) to catch all cases where execution leaves a compiler-instrumented module by allowing the tool to rewrite targets of indirect calls. This change is an optimization that skips wrapping for calls when target is inside the current module. This relies on the linker providing symbols at the begin and end of the module code (or code + data, does not really matter). Gold linker provides such symbols by default. GNU (BFD) linker needs a link flag: -Wl,--defsym=__executable_start=0. More info: https://code.google.com/p/memory-sanitizer/wiki/MSanDR#Native_exec git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194697 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-cov: Added call to update run/program counts.Yuchen Wu2013-11-12
| | | | | | Also updated test files that were generated from this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194453 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Propagate origin for insertvalue, extractvalue.Evgeniy Stepanov2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194374 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR17635: false positive with packed structuresNuno Lopes2013-10-24
| | | | | | LLVM optimizers may widen accesses to packed structures that overflow the structure itself, but should be in bounds up to the alignment of the object git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193317 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed comment typo in GCOVProfiling.cppYuchen Wu2013-10-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193268 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Use zero-extension in shadow cast by default.Evgeniy Stepanov2013-10-17
| | | | | | | Switch to sign-extension in r192575 caused 7% perf loss on 482.sphinx3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192882 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: implement no_sanitize_thread attributeDmitry Vyukov2013-10-17
| | | | | | | | | If a function has no_sanitize_thread attribute, do not instrument memory accesses in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192871 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Optimize accesses to global arrays with constant indexKostya Serebryany2013-10-16
| | | | | | | | | | | | | | | | | | | | Summary: Given a global array G[N], which is declared in this CU and has static initializer avoid instrumenting accesses like G[i], where 'i' is a constant and 0<=i<N. Also add a bit of stats. This eliminates ~1% of instrumentations on SPEC2006 and also partially helps when asan is being run together with coverage. Reviewers: samsonov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1947 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192794 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove lib/Transforms/Instrumentation/ProfilingUtils.*Rafael Espindola2013-10-14
| | | | | | | | They were leftover from the old profiling support. Patch by Alastair Murray. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192605 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Instrument x86.*_cvt* intrinsics.Evgeniy Stepanov2013-10-14
| | | | | | | | | Currently MSan checks that arguments of *cvt* intrinsics are fully initialized. That's too much to ask: some of them only operate on lower half, or even quarter, of the input register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192599 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of scalar select of vectors.Evgeniy Stepanov2013-10-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192575 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the very substantial, largely unmaintained legacy PGOChandler Carruth2013-10-02
| | | | | | | | | | | | | | | | | | | | infrastructure. This was essentially work toward PGO based on a design that had several flaws, partially dating from a time when LLVM had a different architecture, and with an effort to modernize it abandoned without being completed. Since then, it has bitrotted for several years further. The result is nearly unusable, and isn't helping any of the modern PGO efforts. Instead, it is getting in the way, adding confusion about PGO in LLVM and distracting everyone with maintenance on essentially dead code. Removing it paves the way for modern efforts around PGO. Among other effects, this removes the last of the runtime libraries from LLVM. Those are being developed in the separate 'compiler-rt' project now, with somewhat different licensing specifically more approriate for runtimes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191835 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove several unused variables.Rafael Espindola2013-10-01
| | | | | | Patch by Alp Toker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191757 91177308-0d34-0410-b5e6-96231b3b80d8
* BoundsChecking: Fix refacto.Benjamin Kramer2013-09-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191676 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert manual insert point restores to the new RAII object.Benjamin Kramer2013-09-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191675 91177308-0d34-0410-b5e6-96231b3b80d8
* Use right pointer type in DebugIRMatt Arsenault2013-09-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191576 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix -Wreturn-type warnings in non-self-hosted build.Evgeniy Stepanov2013-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191361 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Handling of atomic load/store, atomic rmw, cmpxchg.Evgeniy Stepanov2013-09-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191287 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Wrap indirect functions.Evgeniy Stepanov2013-09-19
| | | | | | | | | | Adds a flag to the MemorySanitizer pass that enables runtime rewriting of indirect calls. This is part of MSanDR implementation and is needed to return control to the DynamiRio-based helper tool on transition between instrumented and non-instrumented modules. Disabled by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191006 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] call __asan_stack_malloc_N only if use-after-return detection is ↵Kostya Serebryany2013-09-18
| | | | | | enabled with the run-time option git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190939 91177308-0d34-0410-b5e6-96231b3b80d8
* ifndef NDEBUG-out an asserts-only constant committed in r190863David Blaikie2013-09-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190905 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] inline the calls to __asan_stack_free_* with small sizes. Yet another ↵Kostya Serebryany2013-09-17
| | | | | | 10%-20% speedup for use-after-return git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190863 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Check return value of main().Evgeniy Stepanov2013-09-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190782 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Add source file:line to stack origin reports.Evgeniy Stepanov2013-09-13
| | | | | | | Compiler part. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190689 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Give internal classes hidden visibility."Benjamin Kramer2013-09-11
| | | | | | | It works with clang, but GCC has different rules so we can't make all of those hidden. This reverts commit r190534. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190536 91177308-0d34-0410-b5e6-96231b3b80d8
* Give internal classes hidden visibility.Benjamin Kramer2013-09-11
| | | | | | Worth 100k on a linux/x86_64 Release+Asserts clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190534 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] refactor the use-after-return API so that the size class is computed ↵Kostya Serebryany2013-09-10
| | | | | | at compile time instead of at run-time. llvm part git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190407 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-09
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190328 91177308-0d34-0410-b5e6-96231b3b80d8
* TBAA: add isTBAAVtableAccess to MDNode so clients can call the functionManman Ren2013-09-06
| | | | | | | | | | | | | | instead of having its own implementation. The implementation of isTBAAVtableAccess is in TypeBasedAliasAnalysis.cpp since it is related to the format of TBAA metadata. The path for struct-path tbaa will be exercised by test/Instrumentation/ThreadSanitizer/read_from_global.ll, vptr_read.ll, and vptr_update.ll when struct-path tbaa is on by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190216 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of select with struct arguments.Evgeniy Stepanov2013-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189796 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix select instrumentation.Evgeniy Stepanov2013-09-03
| | | | | | | | Select condition shadow was being ignored resulting in false negatives. This change OR-s sign-extended condition shadow into the result shadow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189785 91177308-0d34-0410-b5e6-96231b3b80d8
* 80 colsAlexey Samsonov2013-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189473 91177308-0d34-0410-b5e6-96231b3b80d8
* DataFlowSanitizer: Implement trampolines for function pointers passed to ↵Peter Collingbourne2013-08-27
| | | | | | | | custom functions. Differential Revision: http://llvm-reviews.chandlerc.com/D1503 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189408 91177308-0d34-0410-b5e6-96231b3b80d8
* DataFlowSanitizer: correctly combine labels in the case where they are equal.Peter Collingbourne2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189133 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of va_arg overflow area on x86_64.Evgeniy Stepanov2013-08-23
| | | | | | | | | | The code was erroneously reading overflow area shadow from the TLS slot, bypassing the local copy. Reading shadow directly from TLS is wrong, because it can be overwritten by a nested vararg call, if that happens before va_start. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189104 91177308-0d34-0410-b5e6-96231b3b80d8
* 80 colsAlexey Samsonov2013-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189091 91177308-0d34-0410-b5e6-96231b3b80d8
* DataFlowSanitizer: Replace non-instrumented aliases of instrumented ↵Peter Collingbourne2013-08-22
| | | | | | | | functions, and vice versa, with wrappers. Differential Revision: http://llvm-reviews.chandlerc.com/D1442 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189054 91177308-0d34-0410-b5e6-96231b3b80d8
* DataFlowSanitizer: Factor the wrapper builder out to buildWrapperFunction.Peter Collingbourne2013-08-22
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1441 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189053 91177308-0d34-0410-b5e6-96231b3b80d8