[PATCH] D62909: [MSAN] Add unary FNeg visitor to the MemorySanitizer

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 15:34:28 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL362664: [MSAN] Add unary FNeg visitor to the MemorySanitizer (authored by mcinally, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62909?vs=203248&id=203263#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62909/new/

https://reviews.llvm.org/D62909

Files:
  llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll


Index: llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
===================================================================
--- llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
+++ llvm/trunk/test/Instrumentation/MemorySanitizer/msan_basic.ll
@@ -438,6 +438,22 @@
 ; 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 {
Index: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -2110,6 +2110,8 @@
     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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62909.203263.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190605/e4cbea9d/attachment.bin>


More information about the llvm-commits mailing list