llvm/test/Instrumentation/MemorySanitizer
Adhemerval Zanella e25b385a34 [sanitizer] [msan] Fix origin store of array types
This patch fixes the memory sanitizer origin store instrumentation for
array types.  This can be triggered by cases where frontend lowers
function return to array type instead of aggregation.

For instance, the C code:

--
struct mypair {
 int64_t x;
 int y;
};

mypair my_make_pair(int64_t x, int y)  {
 mypair p;
 p.x = x;
 p.y = y;
 return p;
}

int foo (int p)
{
  mypair z = my_make_pair(p, 0);
  return z.y + z.x;
}
--

It will be lowered with target set to aarch64-linux and -O0 to:

--
[...]
define i32 @_Z3fooi(i32 %p) #0 {
[...]
%call = call [2 x i64] @_Z12my_make_pairxi(i64 %conv, i32 0)
%1 = bitcast %struct.mypair* %z to [2 x i64]*
store [2 x i64] %call, [2 x i64]* %1, align 8
[...]
--

The origin store will emit a 'icmp' to test each store value again the
TLS origin array.  However since 'icmp' does not support ArrayType the
memory instrumentation phase will bail out with an error.

This patch change it by using the same strategy used for struct type on
array.

It fixes the 'test/msan/insertvalue_origin.cc' for aarch64 (the -O0 case).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-11 19:55:27 +00:00
..
AArch64 [sanitizer] [msan] VarArgHelper for AArch64 2015-12-14 14:14:15 +00:00
X86 [msan] A no-op implementation of VarArg handling. 2013-05-21 12:27:47 +00:00
array_types.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
atomics.ll Use CHECK-LABEL in MSan IR tests. 2015-08-25 20:59:26 +00:00
byval-alignment.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
check_access_address.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
check-constant-shadow.ll [msan] Optimize -msan-check-constant-shadow. 2015-01-20 15:21:35 +00:00
instrumentation-with-call-threshold.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
missing_origin.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
msan_basic.ll Revert "Change memcpy/memset/memmove to have dest and source alignments." 2015-11-19 05:56:52 +00:00
mul_by_constant.ll [msan] Fix crash on multiplication by a non-integer constant. 2015-10-14 00:21:13 +00:00
origin-alignment.ll [msan] Relax origin-alignment test. 2015-11-24 21:44:16 +00:00
origin-array.ll [sanitizer] [msan] Fix origin store of array types 2016-01-11 19:55:27 +00:00
return_from_main.ll Use CHECK-LABEL in MSan IR tests. 2015-08-25 20:59:26 +00:00
store-long-origin.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
store-origin.ll DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
unreachable.ll Use CHECK-LABEL in MSan IR tests. 2015-08-25 20:59:26 +00:00
vector_arith.ll [msan] Handle X86 *.psad.* and *.pmadd.* intrinsics. 2014-06-18 12:02:29 +00:00
vector_cvt.ll Use CHECK-LABEL in MSan IR tests. 2015-08-25 20:59:26 +00:00
vector_pack.ll [msan] Fix vector pack intrinsic handling. 2014-06-09 08:40:16 +00:00
vector_shift.ll Use CHECK-LABEL in MSan IR tests. 2015-08-25 20:59:26 +00:00