summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-271-6/+4
| | | | | | just letting them be implicitly created. llvm-svn: 216525
* Kill unnecessary includeAlexey Samsonov2014-07-081-1/+0
| | | | llvm-svn: 212503
* 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 sanitizer blacklist from ASan/TSan/MSan function passes.Alexey Samsonov2014-06-021-14/+4
| | | | | | | | | | | | | | | | | 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
* [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-291-22/+19
| | | | llvm-svn: 209834
* [C++] Use 'nullptr'. Transforms edition.Craig Topper2014-04-251-4/+4
| | | | llvm-svn: 207196
* Fix handling of missing DataLayout in sanitizers.Evgeniy Stepanov2014-04-231-1/+1
| | | | | | | Pass::doInitialization is supposed to return False when it did not change the program, not when a fatal error occurs. llvm-svn: 206975
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-2/+2
| | | | | | | | | | | | | | | | | 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
* IR: add a second ordering operand to cmpxhg for failureTim Northover2014-03-111-17/+2
| | | | | | | | | | | | | | | 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 llvm-svn: 203559
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-051-3/+3
| | | | | | class. llvm-svn: 202953
* Make DataLayout a plain object, not a pass.Rafael Espindola2014-02-251-2/+3
| | | | | | | Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM don't don't handle passes to also use DataLayout. llvm-svn: 202168
* Make some DataLayout pointers const.Rafael Espindola2014-02-241-1/+1
| | | | | | No functionality change. Just reduces the noise of an upcoming patch. llvm-svn: 202087
* Rename many DataLayout variables from TD to DL.Rafael Espindola2014-02-211-7/+7
| | | | | | | | | I am really sorry for the noise, but the current state where some parts of the code use TD (from the old name: TargetData) and other parts use DL makes it hard to write a patch that changes where those variables come from and how they are passed along. llvm-svn: 201827
* Fix known typosAlp Toker2014-01-241-1/+1
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* [tsan] fix PR18146: sometimes a variable written into vptr could have an ↵Kostya Serebryany2013-12-051-1/+3
| | | | | | integer type (after other optimizations) llvm-svn: 196507
* [tsan] fix instrumentation of vector vptr updates ↵Kostya Serebryany2013-12-021-4/+7
| | | | | | (https://code.google.com/p/thread-sanitizer/issues/detail?id=43) llvm-svn: 196079
* tsan: implement no_sanitize_thread attributeDmitry Vyukov2013-10-171-1/+1
| | | | | | | If a function has no_sanitize_thread attribute, do not instrument memory accesses in it. llvm-svn: 192871
* TBAA: add isTBAAVtableAccess to MDNode so clients can call the functionManman Ren2013-09-061-6/+2
| | | | | | | | | | | | | 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. llvm-svn: 190216
* Add SpecialCaseList::createOrDie() factory and use it in sanitizer passesAlexey Samsonov2013-08-121-1/+1
| | | | llvm-svn: 188169
* Rename BlackList class to SpecialCaseList and move it to Transforms/Utils.Peter Collingbourne2013-07-091-3/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1089 llvm-svn: 185975
* Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.Michael J. Spencer2013-05-241-1/+1
| | | | llvm-svn: 182680
* [tsan] make sure memset/memcpy/memmove are not inlined in tsan modeKostya Serebryany2013-03-281-0/+52
| | | | llvm-svn: 178230
* tsan: handle vptr loads speciallyDmitry Vyukov2013-03-221-0/+10
| | | | | | | This is required to determine ctor/dtor vs virtual call races. http://llvm-reviews.chandlerc.com/D566 llvm-svn: 177717
* Sort all of the includes. Several files got checked in with mis-sortedChandler Carruth2013-01-191-1/+1
| | | | | | includes. llvm-svn: 172891
* Move Blacklist.h to include/ to enable use from clang.Will Dietz2013-01-181-1/+1
| | | | llvm-svn: 172806
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-8/+8
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.Alexey Samsonov2012-12-281-10/+10
| | | | llvm-svn: 171183
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-8/+8
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* [asan/tsan] initialize the asan/tsan callbacks in runOnFunction as opposed ↵Kostya Serebryany2012-11-291-11/+17
| | | | | | to doInitialization. This is required to allow the upcoming changes in PassManager behavior llvm-svn: 168864
* tsan: instrument atomic nand operationDmitry Vyukov2012-11-271-0/+2
| | | | llvm-svn: 168684
* Remove stray trailing backslashMatt Beaumont-Gay2012-11-261-1/+1
| | | | llvm-svn: 168592
* tsan: fix lint warningsDmitry Vyukov2012-11-261-2/+2
| | | | llvm-svn: 168590
* [tsan] add fail order to compare_exchangeDmitry Vyukov2012-11-261-3/+27
| | | | llvm-svn: 168586
* [TSan] fix indentationAlexey Samsonov2012-11-141-1/+1
| | | | llvm-svn: 167928
* tsan: switch to new memory_order constants (ABI compatible)Dmitry Vyukov2012-11-091-8/+7
| | | | llvm-svn: 167615
* tsan: instrument all atomics (including fetch_add, exchange, cas, etc)Dmitry Vyukov2012-11-091-8/+76
| | | | llvm-svn: 167612
* Back out r166591, not sure why this made it through since I cancelled the ↵Micah Villmow2012-10-241-2/+2
| | | | | | command. Bleh, sorry about this! llvm-svn: 166596
* Delete a directory that wasn't supposed to be checked in yet.Micah Villmow2012-10-241-2/+2
| | | | llvm-svn: 166591
* Move TargetData to DataLayout.Micah Villmow2012-10-081-3/+3
| | | | llvm-svn: 165402
* [tsan] add 3 internal flags for fine-grain control of what is instrumented ↵Kostya Serebryany2012-10-041-7/+18
| | | | | | and what is not. llvm-svn: 165204
* tsan: prepare for migration to new memory_order enum values (ABI compatible)Dmitry Vyukov2012-10-031-1/+2
| | | | llvm-svn: 165107
* WhitespaceAlexey Samsonov2012-08-301-3/+3
| | | | llvm-svn: 162907
* [asan/tsan] rename FunctionBlackList* to BlackList* as this class is not ↵Kostya Serebryany2012-08-241-3/+3
| | | | | | limited to functions any more llvm-svn: 162566
* [tsan] fix compile-time falilure found while building Chromium with tsan ↵Kostya Serebryany2012-07-051-0/+5
| | | | | | (tsan issue #3). A unit test will follow separately. llvm-svn: 159736
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-291-7/+7
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. llvm-svn: 159421
* [tsan] typo and style (thanks to Nick Lewycky)Kostya Serebryany2012-05-021-9/+9
| | | | llvm-svn: 155986
* [tsan] Atomic support for ThreadSanitizer, patch by Dmitry VyukovKostya Serebryany2012-04-271-33/+152
| | | | llvm-svn: 155698
* [tsan] use llvm/ADT/Statistic.h for tsan statsKostya Serebryany2012-04-231-40/+17
| | | | llvm-svn: 155341
OpenPOWER on IntegriCloud