Skip to content

Add structured atomic lowering - #31

Draft
nhat-nguyen wants to merge 2 commits into
mainfrom
nhat/tts.atomic_rmw
Draft

Add structured atomic lowering#31
nhat-nguyen wants to merge 2 commits into
mainfrom
nhat/tts.atomic_rmw

Conversation

@nhat-nguyen

Copy link
Copy Markdown
Contributor

Add structured tts.atomic_rmw and tts.atomic_cas operations and lower eligible Triton atomics to them from pointer analysis.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 29, 2026
@nhat-nguyen
nhat-nguyen force-pushed the nhat/tts.atomic_rmw branch from 5af79a6 to 3b08132 Compare May 30, 2026 03:53
Nhat Nguyen added 2 commits May 30, 2026 03:04
Add structured `tts.atomic_rmw` and `tts.atomic_cas` operations and lower eligible Triton atomics to them from pointer analysis. The RMW op also participates in the existing mask-dimension folder, and rewritten atomics now skip the erased op during the preorder walk.

This combines the internal atomic RMW, RMW verifier, CAS, and walk-fix changes into one upstreamable feature patch. The scalar-splat atomic follow-up is left out because the GitHub base does not yet contain the separate scalar-store rewrite it extends.

Tests: cmake --build /tmp/triton/build/cmake.macosx-26.2-arm64-cpython-3.12 --target triton-shared-opt

Tests: lit -j1 -Dfilecheck=/Users/nhat/.triton/llvm/llvm-87717bf9-macos-arm64/bin/FileCheck -sv /tmp/triton/build/cmake.macosx-26.2-arm64-cpython-3.12/third_party/triton_shared/test --filter atomics

Tests: lit -j1 -Dfilecheck=/Users/nhat/.triton/llvm/llvm-87717bf9-macos-arm64/bin/FileCheck -sv /tmp/triton/build/cmake.macosx-26.2-arm64-cpython-3.12/third_party/triton_shared/test/Conversion/TritonToStructured

Tests: lit -j1 -Dfilecheck=/Users/nhat/.triton/llvm/llvm-87717bf9-macos-arm64/bin/FileCheck -sv /tmp/triton/build/cmake.macosx-26.2-arm64-cpython-3.12/third_party/triton_shared/test
@nhat-nguyen
nhat-nguyen force-pushed the nhat/tts.atomic_rmw branch from 3b08132 to 985e260 Compare May 30, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant