[PATCH] D131845: [MSAN] Correct shadow type for atomicrmw instrumentation
Keno Fischer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 13 19:11:36 PDT 2022
loladiro updated this revision to Diff 452468.
loladiro added a comment.
fixup CHECKs
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131845/new/
https://reviews.llvm.org/D131845
Files:
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/atomics.ll
Index: llvm/test/Instrumentation/MemorySanitizer/atomics.ll
===================================================================
--- llvm/test/Instrumentation/MemorySanitizer/atomics.ll
+++ llvm/test/Instrumentation/MemorySanitizer/atomics.ll
@@ -22,6 +22,20 @@
; CHECK: store i32 0, {{.*}} @__msan_retval_tls
; CHECK: ret i32
+; atomicrmw xchg ptr: exactly the same as above
+
+define i32* @AtomicRmwXchgPtr(i32** %p, i32* %x) sanitize_memory {
+entry:
+ %0 = atomicrmw xchg i32** %p, i32* %x seq_cst
+ ret i32* %0
+}
+
+; CHECK-LABEL: @AtomicRmwXchgPtr
+; CHECK: store i64 0,
+; CHECK: atomicrmw xchg {{.*}} seq_cst
+; CHECK: store i64 0, {{.*}} @__msan_retval_tls
+; CHECK: ret i32*
+
; atomicrmw max: exactly the same as above
Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1949,7 +1949,7 @@
IRBuilder<> IRB(&I);
Value *Addr = I.getOperand(0);
Value *Val = I.getOperand(1);
- Value *ShadowPtr = getShadowOriginPtr(Addr, IRB, Val->getType(), Align(1),
+ Value *ShadowPtr = getShadowOriginPtr(Addr, IRB, getShadowTy(Val), Align(1),
/*isStore*/ true)
.first;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131845.452468.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220814/6303d4cc/attachment.bin>
More information about the llvm-commits
mailing list