History log of /external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cd81d94322a39503e4a3e87b6ee03d4fcb3465fb 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
34432aeb6d42fbe3e327d1d339ea4156c99aa133 14-Nov-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fast path optimization for wrap-indirect-calls feature of 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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
4590b8c090dade63d6cb1ba39109331607036f4d 11-Nov-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Propagate origin for insertvalue, extractvalue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
f5e3811607dd54fded0bb6b6ab97345446e086b9 17-Oct-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Use zero-extension in shadow cast by default.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
95864303f5054c68043febc861764070e8f13913 14-Oct-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Instrument x86.*_cvt* intrinsics.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
a0f6d1651b08254982244e18afcdd513ca34a3ca 14-Oct-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of scalar select of vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
63799f6febc91ebec0d308737bfd1c659e4c24b7 25-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix -Wreturn-type warnings in non-self-hosted build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
ecf0fcd2b17ccc71b2a7b5849c1416aeb48a9390 24-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Handling of atomic load/store, atomic rmw, cmpxchg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
6591308b7e041bb8e5e211f84bcc4a97d3764cc5 19-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Wrap indirect functions.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
e5c8c5a1bcecff7e2aa60672be6af2062ad63e6a 16-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Check return value of main().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
993a0c56ec166ed1e6cc5b9275f81bc3ca4ed880 13-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Add source file:line to stack origin reports.

Compiler part.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
69086b2962b16a9e78aea0605202c5ea126049ae 03-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of select with struct arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
6a9b29ec9b42e792732659e510a655449a41b661 03-Sep-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix select instrumentation.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
7c7b8e57f8f3d20610cdbf1888e2f0101752f986 23-Aug-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of va_arg overflow area on x86_64.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
e39e1316f034e9932cb8da535541a3e35a0e490a 12-Aug-2013 Alexey Samsonov <samsonov@google.com> Add SpecialCaseList::createOrDie() factory and use it in sanitizer passes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188169 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
405515d55f470d04ef75f653b7f1994329c9066b 10-Jul-2013 Peter Collingbourne <peter@pcc.me.uk> Rename BlackList class to SpecialCaseList and move it to Transforms/Utils.

Differential Revision: http://llvm-reviews.chandlerc.com/D1089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
d55ef5ce5f92fc02063e65ef328b89a7d66a3636 03-Jul-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Unpoison stack allocations and undef values in blacklisted functions.

This changes behavior of -msan-poison-stack=0 flag from not poisoning stack
allocations to actively unpoisoning them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
7ae921dbec5db9823c89fa736b2a4c3afe163e4f 31-May-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Handle mixed track-origins and keep-going settings (llvm part).

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
9903f75bf6ec4136bd752595c689db845eedad3d 28-May-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix argument shadow alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
bf4150656f9d82b26864c1115e8444dd3eae4cee 21-May-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] A no-op implementation of VarArg handling.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
8f79b2f762a1f6ca933892aed35bfb2471c39201 16-May-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Switch TLS globals to initial-exec model.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2c694171a597a90c1b7c95b8704ff0d010f9ce3c 09-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Fix a documentation warning: \bried -> \brief


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
930a4fa8e5ef7d9937635d9058d6ab315fa4a314 21-Mar-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Add an option to disable poisoning of shadow for undef values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
5e812139690ce077d568ef6559992b2cf74eb536 28-Feb-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Implement sanitize_memory attribute.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
14eadeda001cf5bcf0d8845e26db93c242bf9fd4 28-Feb-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Remove unused leftover declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
f1af1feeee0f0ec797410762c006211f9c1e2a0f 29-Jan-2013 Edwin Vane <edwin.vane@intel.com> Fixing warnings revealed by gcc release build

Fixed set-but-not-used warnings.

Reviewer: gribozavr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
647c66e24dc913db8e3e038d2fe6351bd98941a2 28-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Mostly disable msan-handle-icmp-exact.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
ccfc295b9d8f895432910a140d20446b5bafc4c4 28-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Revert r173678.

Broken tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2f36a169a5fa0d31ce3b48f81f48c8b4963d8d0c 28-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Make msan-handle-icmp-exact=0 by default.

50% slowdown on one of the specs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
94d1f5b10cbc65d12fc8eb46fd36a2f407cf4a35 25-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] A comment on ICmp handling logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
351f65d9723c075af86466c07a0a3dc28be272cd 25-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Implement exact shadow propagation for relational ICmp.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
8246df61f6de716acf1f8c64fac3c19970a2c174 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
be0008a4df72bf9da3246707cdec2766ace75d32 22-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Export the value of msan-keep-going flag for the runtime.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173156 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
4247b13252a99b284e1ed396be9755878d42df2a 22-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Do not insert check on volatile store.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
90230c84668269fbd53d163e398cd16486d5d414 19-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Sort all of the includes. Several files got checked in with mis-sorted
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
ae36eccdfbad53a1e76ca263b7540b84d50d3524 18-Jan-2013 Will Dietz <wdietz2@illinois.edu> Move Blacklist.h to include/ to enable use from clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
967a946cb463c8b137c6e040f62100efebad93b1 15-Jan-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of equality comparison of pointer vectors.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
03de2a621c2f063294eb3f65ea1136f3acac4e98 10-Jan-2013 Peter Collingbourne <peter@pcc.me.uk> [msan] Change va_start/va_copy shadow memset alignment to 8.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
351ba145a7db32b457f118ecc4d873765ac2a16b 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Actually update the CMake and Makefile builds correctly, and update the
code that includes Intrinsics.gen directly.

This never showed up in my testing because the old Intrinsics.gen was
still kicking around in the make build system and was correct there. =[
Thankfully, some of the bots to clean rebuilds and that caught this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
f045df1b8b7f80e17e34c2b5639082a1d0e289ae 28-Dec-2012 Alexey Samsonov <samsonov@google.com> Add proper support for -fsanitize-blacklist= flag for TSan and MSan. LLVM part.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
b53be53c72ff7b3846f0ba990a889de444601e0b 26-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Raise alignment of origin stores/loads when possible.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
ab29644a33c3cbd237a9844a1e1b69b07c6fb8c3 26-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Expand the file comment with track-origins info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
59a65f7b24350cf483d777acfb403e9b8a31a771 25-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of vectors of pointers.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
6607716368ba04454ff9ad62ac25936357d67c51 25-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix handling of select with vector condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
3333e668221f52f8c708df0037ee9c4bf2417929 21-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Remove unreachable blocks before instrumenting a function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
33660cdfbd521f39982e86844db6784848b8f5d5 19-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Add track-origins argument to the pass constructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
b8837ab8fc22bc9c1d23577e4cdfb732f710478f 19-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Heuristically instrument unknown intrinsics.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
034b94b17006f51722886b0f2283fb6fb19aca1f 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2dfa3eb56679fcb0ac36d2956924e59acf4fc19e 17-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix lint warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
79c3742620efccf7c36ea1738bb121ad70d644d0 14-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Fix lint warnings in MemorySanitizer.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
63cca4e2fd4dd70e54055c4d34d858f810e0bd44 14-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Origin stores and loads do not need explicit alignment.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
e08878efa34b506e6baff04df6c29e65bef24daa 14-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Refactor default shadow propagation and origin tracking.

This change moves the code for default shadow propagaition (handleShadowOr)
and origin tracking (setOriginForNaryOp) into a new builder-like class. Also
gets rid of handleShadowOrBinary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
7fa22404855e996efb1963b9152505c9e1f27fd5 11-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Use explicitely aligned stores and loads with function argument shadow.

Use explicitely aligned store and load instructions to deal with argument and
retval shadow. This matters when an argument's alignment is higher than
__msan_param_tls alignment (which is the case with __m128i).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502 08-Dec-2012 Bill Wendling <isanbard@gmail.com> s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169651 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
ece6db5f16a83ff4cab3544643d226eeb8a15784 07-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Remove readonly/readnone attributes from all called functions.

MSan uses a TLS slot to pass shadow for function arguments and return values.
This makes all instrumented functions not readonly, and at the same time
requires that all callees of an instrumented function that may be
MSan-instrumented do not have readonly attribute (otherwise some of the
instrumentation may be optimized out).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
67b9928a937f57831c7270ba9911515d64c2cfb9 06-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> MemorySanitizer.cpp: Suppress a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
7baaee37cc4391b472fcce572d1ae68a8c547a71 06-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix a typo in a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
4031b194acd50f35b75658f66ee3bb1b4afcfd25 06-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Do not store origin for clean values.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1e3b656be52e94c523d5fdb5a586a62ec59c3c51 05-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Instrument bswap intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
1b3fcf94a49fbbf0b1d0fb6086c3349c2092bd75 05-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Initialize callbacks in runOnFunction as opposed to doInitialization.

This mirrors the change in ASan & TSan done in r168864.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
61cac0619a0f02107d97ae6367f5af38bb4c628f 05-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Change linkage type of __msan_track_origins.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
84bcf93e0fd225de2217d1b712c01586a633a6d8 30-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Move the InstVisitor utility into VMCore where it belongs. It heavily
depends on the IR infrastructure, there is no sense in it being off in
Support land.

This is in preparation to start working to expand InstVisitor into more
special-purpose visitors that are still generic and can be re-used
across different passes. The expansion will go into the Analylis tree
though as nothing in VMCore needs it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
cb5d04a9045b59d6aaf8707c63e9a90ad7a40c08 29-Nov-2012 Matt Beaumont-Gay <matthewbg@google.com> Apply Takumi's patch to suppress unused-variable warnings in -Asserts builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2aac38541708f37f9ddc5b2d3047b68835484a23 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Handle vector manipulation instructions.

Handle insertelement, extractelement, shufflevector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
b096a9d02f1edc59a06258391fe26d3f6cddda07 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix getOriginForNaryOp.

The old version failed on a 3-arg instruction with (-1, 0, 0) shadows (it would
pick the 3rd operand origin irrespective of its shadow).

The new version always picks the origin of the rightmost poisoned operand.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
6d988b423acf37ed4d0b50b2678a18f65ab1a207 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Basic handling of inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
84af05e1ba3a97d98b76929df858edc7b8b0d252 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Propagate shadow through (x<0) and (x>=0) comparisons.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
3a10b49781afcf0ea445d69dfc6949335269f231 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix shadow & origin store & load alignment.

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
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
af4451b37e381c643144dc00614e63eef8db6082 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Optimize getOriginPtr.

Rewrite getOriginPtr in a way that lets subsequent optimizations factor out
the common part of Shadow and Origin address calculation. Improves perf by
up to 5%.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2ea25f2f1cd29b617c768af504210127827fa2e3 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Fix a few compilation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
2e815e7cf4f31c53ad64059192e70828d476680e 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Transform memcpy and memset to library calls.

This was already done for memmove, where it is required for correctness.
This change improves performance by avoiding copyingthe same memory twice.
Also, the library functions are given __msan_ prefix to prevent instcombine
pass from converting them back to intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
f62b4e3ee3cc667020d5de91dfec69ce58c1d1ea 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Make sure that report callbacks do not get merged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
aa4f97d6ed9c2b6db6a902d796d86d566c804008 29-Nov-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Initial commit of MemorySanitizer.

Compiler pass only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp