diff options
author | Rui Ueyama <ruiu@google.com> | 2017-10-02 20:16:13 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-10-02 20:16:13 +0000 |
commit | abf908e632a6abde17f8943af642216f05161720 (patch) | |
tree | 405451127aa32b124cb9264352254ccf916a6b81 /llvm/lib/CodeGen/MachineCopyPropagation.cpp | |
parent | 5ad573616e4b17b71ca5e512b87764e2eea29a82 (diff) | |
download | llvm-abf908e632a6abde17f8943af642216f05161720.zip llvm-abf908e632a6abde17f8943af642216f05161720.tar.gz llvm-abf908e632a6abde17f8943af642216f05161720.tar.bz2 |
Fix a data race found by tsan.
Reads from `Live` and writes to `OutputOff` in the following code race
even though they are logically independent because they are bitfields
sharing the same word.
for (size_t I = 0, E = Sec->Pieces.size(); I != E; ++I) {
if (!Sec->Pieces[I].Live)
continue;
CachedHashStringRef Str = Sec->getData(I);
size_t ShardId = getShardId(Str.hash());
if ((ShardId & (Concurrency - 1)) == ThreadId)
Sec->Pieces[I].OutputOff = Shards[ShardId].add(Str);
}
llvm-svn: 314711
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
0 files changed, 0 insertions, 0 deletions