summaryrefslogtreecommitdiff
path: root/test/Instrumentation
Commit message (Collapse)AuthorAge
* IR: Add COMDATs to the IRDavid Majnemer2014-06-27
| | | | | | | | | | | | | | | | This new IR facility allows us to represent the object-file semantic of a COMDAT group. COMDATs allow us to tie together sections and make the inclusion of one dependent on another. This is required to implement features like MS ABI VFTables and optimizing away certain kinds of initialization in C++. This functionality is only representable in COFF and ELF, Mach-O has no similar mechanism. Differential Revision: http://reviews.llvm.org/D4178 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211920 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix bad interaction between with-calls mode and chained origin tracking.Evgeniy Stepanov2014-06-25
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211700 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.Evgeniy Stepanov2014-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211156 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of multiplication by a constant with a number of ↵Evgeniy Stepanov2014-06-17
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211092 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove top-level Clang -fsanitize= flags for optional ASan features.Alexey Samsonov2014-06-13
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210924 91177308-0d34-0410-b5e6-96231b3b80d8
* IR: add "cmpxchg weak" variant to support permitted failure.Tim Northover2014-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210903 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce verbiage of lit.local.cfg filesAlp Toker2014-06-09
| | | | | | We can just split targets_to_build in one place and make it immutable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210496 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test in r210472.Evgeniy Stepanov2014-06-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210473 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Workaround for invalid origins in shufflevector.Evgeniy Stepanov2014-06-09
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210472 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix vector pack intrinsic handling.Evgeniy Stepanov2014-06-09
| | | | | | | | | | This fixes a crash on MMX intrinsics, as well as a corner case in handling of all unsigned pack intrinsics. PR19953. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210454 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow aliases to be unnamed_addr.Rafael Espindola2014-06-06
| | | | | | | | | | | | | | | | | | Alias with unnamed_addr were in a strange state. It is stored in GlobalValue, the language reference talks about "unnamed_addr aliases" but the verifier was rejecting them. It seems natural to allow unnamed_addr in aliases: * It is a property of how it is accessed, not of the data itself. * It is perfectly possible to write code that depends on the address of an alias. This patch then makes unname_addr legal for aliases. One side effect is that the syntax changes for a corner case: In globals, unnamed_addr is now printed before the address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210302 91177308-0d34-0410-b5e6-96231b3b80d8
* [asancov] Fix coverage line info some more.Evgeniy Stepanov2014-06-05
| | | | | | | | Now it should always point to the opening brace of the function (in -asan-coverage=1 mode). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210266 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Fix coverage instrumentation with -asan-globals=0.Evgeniy Stepanov2014-06-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210103 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Handle x86 vector pack intrinsics.Evgeniy Stepanov2014-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210020 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Fixup a test case after r209939Alexey Samsonov2014-05-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209945 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Use llvm.global_ctors to insert init-order checking calls into ASan ↵Alexey Samsonov2014-05-29
| | | | | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209780 91177308-0d34-0410-b5e6-96231b3b80d8
* [asancov] Don't emit extra runtime calls when compiling without coverage.Evgeniy Stepanov2014-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209721 91177308-0d34-0410-b5e6-96231b3b80d8
* [asancov] Emit an initializer passing number of coverage code locations in ↵Evgeniy Stepanov2014-05-27
| | | | | | each module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209654 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] properly instrument memory accesses that have small alignment ↵Kostya Serebryany2014-05-23
| | | | | | (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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209508 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Set debug location in ASan function prologue.Evgeniy Stepanov2014-05-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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208767 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Preserve flags in asm instrumentation.Evgeniy Stepanov2014-05-08
| | | | | | | Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208296 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix -fsanitize=memory -fno-integrated-as.Evgeniy Stepanov2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208211 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Add a flag to control asm instrumentation.Evgeniy Stepanov2014-05-07
| | | | | | | With this change, asm instrumentation is disabled by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208167 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Fix instrumentation of x86 intel syntax inline assembly.Evgeniy Stepanov2014-04-24
| | | | | | | | Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207092 91177308-0d34-0410-b5e6-96231b3b80d8
* Create MCTargetOptions.Evgeniy Stepanov2014-04-23
| | | | | | | | | | For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206971 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Support outline instrumentation for wide types and delete dead code, ↵Kostya Serebryany2014-04-22
| | | | | | patch by Yuri Gribov git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206883 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] add llvm-ish test for memset/etc instrumentationKostya Serebryany2014-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206747 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Add -msan-instrumentation-with-call-threshold.Evgeniy Stepanov2014-04-18
| | | | | | | | | | | This flag replaces inline instrumentation for checks and origin stores with calls into MSan runtime library. This is a workaround for PR17409. Disabled by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206585 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] one more workaround for PR17409: don't do BB-level coverage ↵Kostya Serebryany2014-04-18
| | | | | | instrumentation if there are more than N (=1500) basic blocks. This makes ASanCoverage work on libjpeg_turbo/jchuff.c used by Chrome, which has 1824 BBs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206564 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] add two new hidden compile-time flags for asan: ↵Kostya Serebryany2014-04-16
| | | | | | asan-instrumentation-with-call-threshold and asan-memory-access-callback-prefix. This is part of the workaround for PR17409 (instrument huge functions with callbacks instead of inlined code). These flags will also help us experiment with kasan (kernel-asan) and clang git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206383 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Relax the test some more.Evgeniy Stepanov2014-03-25
| | | | | | | | This may or may not fix the bots. R204720 did not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204721 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Make some tests less strict.Evgeniy Stepanov2014-03-25
| | | | | | | This may or may not fix the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204720 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] More precise instrumentation of select IR.Evgeniy Stepanov2014-03-25
| | | | | | | | | | Some bits of select result may be initialized even if select condition is not. https://code.google.com/p/memory-sanitizer/issues/detail?id=50 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204716 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Add -asan-module to the ASan .ll tests.Alexander Potapenko2014-03-20
| | | | | | | | | After the -asan pass had been split into -asan (function-level) and -asan-module (module-level) some of the tests have silently stopped working, because they didn't instrument the globals anymore. We've decided to have every test using both passes, irrespective of the presence of globals in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204335 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Do not instrument globals from the llvm.metadata section.Alexander Potapenko2014-03-20
| | | | | | | | Fixes https://code.google.com/p/address-sanitizer/issues/detail?id=279. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204331 91177308-0d34-0410-b5e6-96231b3b80d8
* Set debug info for instructions inserted in SplitBlockAndInsertIfThen.Evgeniy Stepanov2014-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204230 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Origin tracking with history.Evgeniy Stepanov2014-03-18
| | | | | | | | | LLVM part of MSan implementation of advanced origin tracking, when we record not only creation point, but all locations where an uninitialized value was stored to memory, too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204151 91177308-0d34-0410-b5e6-96231b3b80d8
* AddressSanitizer instrumentation for MOV and MOVAPS.Evgeniy Stepanov2014-03-14
| | | | | | | | | This is an initial version of *Sanitizer instrumentation of assembly code. Patch by Yuri Gorshenin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203908 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix handling of byval arguments in VarArg calls.Evgeniy Stepanov2014-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203794 91177308-0d34-0410-b5e6-96231b3b80d8
* IR: add a second ordering operand to cmpxhg for failureTim Northover2014-03-11
| | | | | | | | | | | | | | | The syntax for "cmpxchg" should now look something like: cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place). rdar://problem/15996804 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203559 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Handle X86 SIMD bitshift intrinsics.Evgeniy Stepanov2014-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202712 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] remove test that should have been removed in r202033Kostya Serebryany2014-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202034 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back r201608, r201622, r201624 and r201625Rafael Espindola2014-02-19
| | | | | | | | | | | | | | r201608 made llvm corretly handle private globals with MachO. r201622 fixed a bug in it and r201624 and r201625 were changes for using private linkage, assuming that llvm would do the right thing. They all got reverted because r201608 introduced a crash in LTO. This patch includes a fix for that. The issue was that TargetLoweringObjectFile now has to be initialized before we can mangle names of private globals. This is trivially true during the normal codegen pipeline (the asm printer does it), but LTO has to do it manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201700 91177308-0d34-0410-b5e6-96231b3b80d8
* This reverts commit r201625 and r201624.Rafael Espindola2014-02-19
| | | | | | | Since r201608 got reverted, it is not safe to use private linkage in these cases until it is committed back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201688 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that llvm always does the right thing with private, use it.Rafael Espindola2014-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201625 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] support for FreeBSD, LLVM part. patch by Viktor KutuzovKostya Serebryany2014-02-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201067 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] simplify a test Kostya Serebryany2014-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200378 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] extend asan-coverage (still experimental).Kostya Serebryany2014-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add a mode for collecting per-block coverage (-asan-coverage=2). So far the implementation is naive (all blocks are instrumented), the performance overhead on top of asan could be as high as 30%. - Make sure the one-time calls to __sanitizer_cov are moved to function buttom, which in turn required to copy the original debug info into the call insn. Here is the performance data on SPEC 2006 (train data, comparing asan with asan-coverage={0,1,2}): asan+cov0 asan+cov1 diff 0-1 asan+cov2 diff 0-2 diff 1-2 400.perlbench, 65.60, 65.80, 1.00, 76.20, 1.16, 1.16 401.bzip2, 65.10, 65.50, 1.01, 75.90, 1.17, 1.16 403.gcc, 1.64, 1.69, 1.03, 2.04, 1.24, 1.21 429.mcf, 21.90, 22.60, 1.03, 23.20, 1.06, 1.03 445.gobmk, 166.00, 169.00, 1.02, 205.00, 1.23, 1.21 456.hmmer, 88.30, 87.90, 1.00, 91.00, 1.03, 1.04 458.sjeng, 210.00, 222.00, 1.06, 258.00, 1.23, 1.16 462.libquantum, 1.73, 1.75, 1.01, 2.11, 1.22, 1.21 464.h264ref, 147.00, 152.00, 1.03, 160.00, 1.09, 1.05 471.omnetpp, 115.00, 116.00, 1.01, 140.00, 1.22, 1.21 473.astar, 133.00, 131.00, 0.98, 142.00, 1.07, 1.08 483.xalancbmk, 118.00, 120.00, 1.02, 154.00, 1.31, 1.28 433.milc, 19.80, 20.00, 1.01, 20.10, 1.02, 1.01 444.namd, 16.20, 16.20, 1.00, 17.60, 1.09, 1.09 447.dealII, 41.80, 42.20, 1.01, 43.50, 1.04, 1.03 450.soplex, 7.51, 7.82, 1.04, 8.25, 1.10, 1.05 453.povray, 14.00, 14.40, 1.03, 15.80, 1.13, 1.10 470.lbm, 33.30, 34.10, 1.02, 34.10, 1.02, 1.00 482.sphinx3, 12.40, 12.30, 0.99, 13.00, 1.05, 1.06 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199488 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Fix the tests broken by r198018 to check for private linkage of ↵Alexander Potapenko2013-12-25
| | | | | | ASan-generated globals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198020 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] don't unpoison redzones on function exit in use-after-return mode.Kostya Serebryany2013-12-23
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change the instrumented code before Ret instructions looked like: <Unpoison Frame Redzones> if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> Now the instrumented code looks like: if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> else <Unpoison Frame Redzones> Reviewers: eugenis Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2458 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197907 91177308-0d34-0410-b5e6-96231b3b80d8