summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-07-17 09:10:37 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-07-17 09:10:37 +0000
commitc8227aa14df8bb0d1d92ecfa2ccf48830dd7709d (patch)
treeacf651e354ae12c03bdc015cb075bd385c4e561c /llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
parent01f56862982c958ad73b4d4b60f0c59d8f383b23 (diff)
downloadbcm5719-llvm-c8227aa14df8bb0d1d92ecfa2ccf48830dd7709d.tar.gz
bcm5719-llvm-c8227aa14df8bb0d1d92ecfa2ccf48830dd7709d.zip
[msan] Avoid redundant origin stores.
Origin is meaningless for fully initialized values. Avoid storing origin for function arguments that are known to be always initialized (i.e. shadow is a compile-time null constant). This is not about correctness, but purely an optimization. Seems to affect compilation time of blacklisted functions significantly. llvm-svn: 213239
Diffstat (limited to 'llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll')
-rw-r--r--llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll b/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
index 51693cdd567..0faf45d70c5 100644
--- a/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
+++ b/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
@@ -766,6 +766,24 @@ cond.end: ; preds = %cond.false, %cond.t
; CHECK: ret i32 [[A]]
+; Test that there are no __msan_param_origin_tls stores when
+; argument shadow is a compile-time zero constant (which is always the case
+; in functions missing sanitize_memory attribute).
+
+define i32 @NoSanitizeMemoryParamTLS(i32* nocapture readonly %x) {
+entry:
+ %0 = load i32* %x, align 4
+ %call = tail call i32 @NoSanitizeMemoryParamTLSHelper(i32 %0)
+ ret i32 %call
+}
+
+declare i32 @NoSanitizeMemoryParamTLSHelper(i32 %x)
+
+; CHECK-LABEL: define i32 @NoSanitizeMemoryParamTLS(
+; CHECK-NOT: __msan_param_origin_tls
+; CHECK: ret i32
+
+
; Test argument shadow alignment
define <2 x i64> @ArgumentShadowAlignment(i64 %a, <2 x i64> %b) sanitize_memory {
OpenPOWER on IntegriCloud