llvm-project/llvm/test/Instrumentation/MemorySanitizer
Alexander Potapenko 5ff3abbc31 [MSan] run materializeChecks() before materializeStores()
When pointer checking is enabled, it's important that every pointer is
checked before its value is used.
For stores MSan used to generate code that calculates shadow/origin
addresses from a pointer before checking it.
For userspace this isn't a problem, because the shadow calculation code
is quite simple and compiler is able to move it after the check on -O2.
But for KMSAN getShadowOriginPtr() creates a runtime call, so we want the
check to be performed strictly before that call.

Swapping materializeChecks() and materializeStores() resolves the issue:
both functions insert code before the given IR location, so the new
insertion order guarantees that the code calculating shadow address is
between the address check and the memory access.

llvm-svn: 337571
2018-07-20 16:28:49 +00:00
..
AArch64 Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
Mips Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
PowerPC Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
X86
alloca.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
array_types.ll
atomics.ll
byval-alignment.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
check-constant-shadow.ll
check_access_address.ll [MSan] run materializeChecks() before materializeStores() 2018-07-20 16:28:49 +00:00
csr.ll
global_ctors_2to3.ll
instrumentation-with-call-threshold.ll
manual-shadow.ll Add msan custom mapping options. 2018-03-29 21:18:17 +00:00
masked-store-load.ll [msan] Instrument masked.store, masked.load intrinsics. 2018-05-15 21:28:25 +00:00
missing_origin.ll Update some code.google.com links 2017-11-13 23:47:58 +00:00
msan_basic.ll [FileCheck] Add -allow-deprecated-dag-overlap to failing llvm tests 2018-07-11 20:25:49 +00:00
msan_x86_bts_asm.ll MSan: introduce the conservative assembly handling mode. 2018-04-03 09:50:06 +00:00
msan_x86intrinsics.ll [x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsics 2018-04-26 21:46:01 +00:00
mul_by_constant.ll
nosanitize.ll [msan] Don't sanitize "nosanitize" instructions 2017-11-20 23:37:56 +00:00
origin-alignment.ll
origin-array.ll
pr32842.ll
return_from_main.ll
store-long-origin.ll
store-origin.ll [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
str-nobuiltin.ll
unreachable.ll
unsized_type.ll
vector_arith.ll
vector_cmp.ll
vector_cvt.ll [X86] Remove and autoupgrade cvtsi2ss/cvtsi2sd intrinsics to match what clang has used for a very long time. 2018-05-12 23:14:39 +00:00
vector_pack.ll
vector_shift.ll
with-call-type-size.ll