Repository navigation
Make LLT::ExtendedLLT atomic - #154
Merged
Merged
Conversation
`AArch64TargetMachine`, `AMDGPUTargetMachine` and `WebAssemblyTargetMachine` constructors unconditionally write the process-global `LLT::ExtendedLLT` flag. When a program creates `TargetMachine`s on several threads while other threads run code generation (as the ClickHouse JIT does), this is a data race reported by ThreadSanitizer. Make the flag a `std::atomic<bool>` with relaxed ordering, the ad-hoc fix suggested in llvm#219517. Related: llvm#219517 Related: ClickHouse/ClickHouse#117346 Co-Authored-By: Claude Opus 5.5 <[email protected]>
lazerg
pushed a commit
to lazerg/ClickHouse
that referenced
this pull request
Nov 17, 2026
`AArch64TargetMachine` constructor writes the process-global `LLT::ExtendedLLT` flag, which raced with `CHJIT` instances created concurrently on other threads (ThreadSanitizer report in `Stress test (arm_tsan)`). The fork now makes the flag a relaxed `std::atomic<bool>`. The update also brings the Clang CFI fixes from the fork (ClickHouse/llvm-project#152). Related: ClickHouse/llvm-project#154 Related: ClickHouse#117346 Related: llvm/llvm-project#219517 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
AArch64TargetMachine,AMDGPUTargetMachineandWebAssemblyTargetMachineconstructors unconditionally write the process-globalLLT::ExtendedLLTflag, which races with other threads constructing target machines or running code generation. ClickHouse creates aTargetMachineperCHJITinstance, and the ARM TSan stress test reports the race inLLT::setUseExtended.Make the flag a relaxed
std::atomic<bool>, the ad-hoc fix suggested upstream.Related: llvm#219517
Related: ClickHouse/ClickHouse#117346
🤖 Generated with Claude Code