llvm.org GIT mirror llvm / 2b65b0f
[MSAN] Add unary FNeg visitor to the MemorySanitizer Differential Revision: https://reviews.llvm.org/D62909 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362664 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally 4 months ago
2 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
21092109 SC.Done(&I);
21102110 }
21112111
2112 void visitFNeg(UnaryOperator &I) { handleShadowOr(I); }
2113
21122114 // Handle multiplication by constant.
21132115 //
21142116 // Handle a special case of multiplication by constant that may have one or
435435 ; CHECK: %[[SC:.*]] = or i32 %[[SB]], %[[SA]]
436436 ; CHECK: = fdiv float
437437 ; CHECK: store i32 %[[SC]], i32* {{.*}}@__msan_retval_tls
438 ; CHECK: ret float
439
440 ; Check that fneg simply propagates shadow.
441
442 define float @FNeg(float %a) nounwind uwtable readnone sanitize_memory {
443 entry:
444 %c = fneg float %a
445 ret float %c
446 }
447
448 ; CHECK-LABEL: @FNeg
449 ; CHECK: %[[SA:.*]] = load i32,{{.*}}@__msan_param_tls
450 ; CHECK-ORIGINS: %[[SB:.*]] = load i32,{{.*}}@__msan_param_origin_tls
451 ; CHECK: = fneg float
452 ; CHECK: store i32 %[[SA]], i32* {{.*}}@__msan_retval_tls
453 ; CHECK-ORIGINS: store i32{{.*}}@__msan_retval_origin_tls
438454 ; CHECK: ret float
439455
440456 ; Check that we propagate shadow for x<0, x>=0, etc (i.e. sign bit tests)