[llvm] r362664 - [MSAN] Add unary FNeg visitor to the MemorySanitizer
Cameron McInally via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 5 15:37:05 PDT 2019
Author: mcinally
Date: Wed Jun 5 15:37:05 2019
New Revision: 362664
URL: http://llvm.org/viewvc/llvm-project?rev=362664&view=rev
Log:
[MSAN] Add unary FNeg visitor to the MemorySanitizer
Differential Revision: https://reviews.llvm.org/D62909
Modified:
llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=362664&r1=362663&r2=362664&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Wed Jun 5 15:37:05 2019
@@ -2110,6 +2110,8 @@ struct MemorySanitizerVisitor : public I
SC.Done(&I);
}
+ void visitFNeg(UnaryOperator &I) { handleShadowOr(I); }
+
// Handle multiplication by constant.
//
// Handle a special case of multiplication by constant that may have one or
Modified: llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll?rev=362664&r1=362663&r2=362664&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll (original)
+++ llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll Wed Jun 5 15:37:05 2019
@@ -438,6 +438,22 @@ entry:
; CHECK: store i32 %[[SC]], i32* {{.*}}@__msan_retval_tls
; CHECK: ret float
+; Check that fneg simply propagates shadow.
+
+define float @FNeg(float %a) nounwind uwtable readnone sanitize_memory {
+entry:
+ %c = fneg float %a
+ ret float %c
+}
+
+; CHECK-LABEL: @FNeg
+; CHECK: %[[SA:.*]] = load i32,{{.*}}@__msan_param_tls
+; CHECK-ORIGINS: %[[SB:.*]] = load i32,{{.*}}@__msan_param_origin_tls
+; CHECK: = fneg float
+; CHECK: store i32 %[[SA]], i32* {{.*}}@__msan_retval_tls
+; CHECK-ORIGINS: store i32{{.*}}@__msan_retval_origin_tls
+; CHECK: ret float
+
; Check that we propagate shadow for x<0, x>=0, etc (i.e. sign bit tests)
define zeroext i1 @ICmpSLTZero(i32 %x) nounwind uwtable readnone sanitize_memory {
More information about the llvm-commits
mailing list