Although rare, atomic accesses to floating-point types seem to be valid, i.e. %a = load atomic float .... The TSan instrumentation pass however tries to emit inttoptr, which is incorrect, we should use a bitcast here. Anyway, IRBuilder already has a convenient helper function for this.
Details
Details
- Reviewers
dvyukov zaks.anna - Commits
- rG19679f97ed7c: [tsan] Cast floating-point types correctly when instrumenting atomic accesses…
rG44e875ad5b2c: [tsan] Cast floating-point types correctly when instrumenting atomic accesses…
rCRT286136: [tsan] Cast floating-point types correctly when instrumenting atomic accesses…
rL286136: [tsan] Cast floating-point types correctly when instrumenting atomic accesses…
rL286135: [tsan] Cast floating-point types correctly when instrumenting atomic accesses…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM with a nit
lib/Transforms/Instrumentation/ThreadSanitizer.cpp | ||
---|---|---|
551–552 ↗ | (On Diff #76805) | It does not look worthwhile to keep this helper function around at all now. Especially that you call CreateBitOrPointerCast directly in instrumentAtomic, so now it's not even a single point of extension. Just replace calls with CreateBitOrPointerCast and remove this function. |