stdarch
stdarch copied to clipboard
add nvptx_target_feature and use unaligned barrier
- Deprecate
_syncthreads(the CUDA name) in favor of new_barrier_sync(NVPTX namebarrier.sync). - The:
barrier.syncinstruction is equivalent tobarrier.sync.alignedprior tosm_70, and will lead to errors/deadlock if passes (such as MIRJumpThreading) lose the aligned property. - Since: MIR does not currently have a way to apply something like LLVM's
convergentattribute (and becauseconvergentdoes not preserve alignment, which can be broken by inlining), we cannot prevent loss of alignment, and thus we require target featuresm_70. In short, we cannot prevent miscompilation of aligned barriers without hard-to-specify preconditions.
This requires https://github.com/rust-lang/rust/pull/138689 (for nvptx_target_feature) and fixes https://github.com/rust-lang/rust/issues/137086.