1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

25 Commits

Author SHA1 Message Date
Evgeniy Stepanov
bce1a20d13 [msan] Switch TLS globals to initial-exec model.
They are always defined in the main executable.

llvm-svn: 181994
2013-05-16 09:14:05 +00:00
Evgeniy Stepanov
f128dbc036 Fix llvm::removeUnreachableBlocks to handle unreachable loops.
llvm-svn: 177713
2013-03-22 08:43:04 +00:00
Evgeniy Stepanov
caac73e5ea [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.

llvm-svn: 176247
2013-02-28 11:25:14 +00:00
Evgeniy Stepanov
b2af9f793f [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.

llvm-svn: 173682
2013-01-28 11:42:28 +00:00
Evgeniy Stepanov
2c975362ac [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.

llvm-svn: 173452
2013-01-25 15:31:10 +00:00
Evgeniy Stepanov
b64d00f355 [msan] Do not insert check on volatile store.
Volatile bitfields can cause valid stores of uninitialized bits.

llvm-svn: 173153
2013-01-22 12:30:52 +00:00
Evgeniy Stepanov
4eadd744d9 [msan] Temporarily remove ICmpEQ tests.
They are failing on the bots.

llvm-svn: 172540
2013-01-15 17:12:04 +00:00
Evgeniy Stepanov
ffcdd9c304 [msan] Fix handling of equality comparison of pointer vectors.
Also improve test coveration of the handling of relational comparisons.

llvm-svn: 172539
2013-01-15 16:44:52 +00:00
Peter Collingbourne
4a5942ae9c [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

llvm-svn: 172128
2013-01-10 22:36:33 +00:00
Evgeniy Stepanov
3c52fb6e43 [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.

llvm-svn: 171110
2012-12-26 11:55:09 +00:00
Evgeniy Stepanov
f41a8d635d [msan] Fix handling of vectors of pointers.
VectorType::getInteger() can not be used with them, because pointer size
depends on the target.

llvm-svn: 171070
2012-12-25 16:04:38 +00:00
Evgeniy Stepanov
e7fdcc5fe1 [msan] Fix handling of select with vector condition.
llvm-svn: 171069
2012-12-25 14:56:21 +00:00
Evgeniy Stepanov
ea2d72253e [msan] Remove unreachable blocks before instrumenting a function.
llvm-svn: 170883
2012-12-21 11:18:49 +00:00
Evgeniy Stepanov
454a4043ba [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.

llvm-svn: 170530
2012-12-19 11:22:04 +00:00
Evgeniy Stepanov
14d36d9b89 [msan] Origin stores and loads do not need explicit alignment.
Origin address is always 4 byte aligned, and the access type is always i32.

llvm-svn: 170199
2012-12-14 13:43:11 +00:00
Evgeniy Stepanov
97d6933f46 [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.

llvm-svn: 169490
2012-12-06 11:41:03 +00:00
Evgeniy Stepanov
21dc8412a5 [msan] Instrument bswap intrinsic.
llvm-svn: 169383
2012-12-05 14:39:55 +00:00
Evgeniy Stepanov
597a835dbc [msan] Change linkage type of __msan_track_origins.
LinkOnceODRLinkage globals may be removed in GlobalOpt if not used in the
current module.

llvm-svn: 169377
2012-12-05 12:49:41 +00:00
Evgeniy Stepanov
34d9c8ee3a Improve MSan tests.
llvm-svn: 169256
2012-12-04 11:42:05 +00:00
Evgeniy Stepanov
d27ab822c9 [msan] Tests for vector manipulation instructions.
llvm-svn: 168997
2012-11-30 12:12:20 +00:00
Evgeniy Stepanov
fafa2ae4b6 [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.

llvm-svn: 168881
2012-11-29 14:25:47 +00:00
Evgeniy Stepanov
fc6164c985 [msan] Fix shadow & origin store & load alignment.
This change ensures that shadow memory accesses have the same alignment
as corresponding app memory accesses.

llvm-svn: 168880
2012-11-29 14:05:53 +00:00
Evgeniy Stepanov
a193a72b44 [msan] Add a test for r168873.
llvm-svn: 168877
2012-11-29 13:11:09 +00:00
Evgeniy Stepanov
ad930ee08f [msan] Update tests (broken in r168873).
llvm-svn: 168874
2012-11-29 12:43:56 +00:00
Evgeniy Stepanov
6d7e99f2ac Initial commit of MemorySanitizer.
Compiler pass only.

llvm-svn: 168866
2012-11-29 09:57:20 +00:00