Add new fixed-size vector clock for the new tsan runtime.
For now it's unused.
Details
- Reviewers
vitalybuka melver - Commits
- rG5c2b48fdb0a6: tsan: add new vector clock
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Review incomplete -- I'll need to look a bit at the rest of the (uncommitted) changes to understand the requirements. But if there are special requirements that aren't obvious, do let us know.
Trying to review the SSE code as well.
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
59 | Any overloaded operators / helpers for these that should be pulled into this patch? | |
compiler-rt/lib/tsan/rtl/tsan_vector_clock.h | ||
35 | Is this the only required operator? |
But if there are special requirements that aren't obvious, do let us know.
Humm... I can't think of any.
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
56 | I infer that this is not actually max Sid (!= 255), because if this were to be stored in Sid it'd overflow. (Since kMaxSid and Sid are incompatible types my guess is that's not happening right now.) kMaxThreadSlots ? | |
compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp | ||
69 | Would be good to make clang-tidy happy unless there's a performance benefit to not have it return *this. |
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
56 | Right, it's not "max", it's "count". |
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
56 | Sounds good. That name to me suggests that there are always kThreadSlotCount slots (no more no less), right? |
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
56 | Yes, my current prototype uses fixed number of slots always. |
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
55 | Why this is "enum class"? |
compiler-rt/lib/tsan/rtl/tsan_defs.h | ||
---|---|---|
55 | Is you mean "instead of typedef", enum class won't convert to any other types implicitly and gives much stronger type safety. |
Why this is "enum class"?