[msan] Set cmpxchg shadow precisely
authorJianzhou Zhao <jianzhouzh@google.com>
Fri, 19 Feb 2021 04:37:49 +0000 (04:37 +0000)
committerJianzhou Zhao <jianzhouzh@google.com>
Fri, 19 Feb 2021 20:23:23 +0000 (20:23 +0000)
commitefc8f3311b57ce438500d8a0908e6c7cf6c9f551
tree5fd0a1beb555651844175c1d07df1ded02d61e67
parent5de47ebff6d763a1ee7030252227a64a6dcce521
[msan] Set cmpxchg shadow precisely

In terms of https://llvm.org/docs/LangRef.html#cmpxchg-instruction,
the return type of chmpxchg is a pair {ty, i1}, while I think we
only wanted to set the shadow for the address 0th op, and it has type
ty.

Reviewed-by: eugenis
Differential Revision: https://reviews.llvm.org/D97029
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/test/Instrumentation/MemorySanitizer/atomics.ll