julia
faeb4e3d - codegen: Lower atomic modify of floating-point values to `atomicrmw`

Commit
27 days ago
codegen: Lower atomic modify of floating-point values to `atomicrmw` Atomic modify of a floating-point field, memory or pointer was excluded from the `julia.atomicmodify` lowering, since codegen handles those values as integers of the same size. It instead emitted the legacy cmpxchg loop calling the op, so for example `@atomic x[i] += v` with `Float64` elements never became an `atomicrmw fadd`. Emit `julia.atomicmodify` on the floating-point type directly, which `ExpandAtomicModifyPass` already knows how to match to `atomicrmw fadd`/`fsub`/`fmin`/`fmax`, and to expand to a cmpxchg loop otherwise. When the op folds to the identity (such as `x + -0.0`), the pass converts it to an `atomicrmw or` with zero, which is only valid for integers, so emit that on the integer type of the same size. Fixes #33325 Assisted-by: Claude Code (Claude Opus 5.5)
Author
Parents
Loading