Skip to content

Bump pliron to 823d9d8 and adopt upstream SyncScopeAttr - #1199

Merged
nihalpasham merged 1 commit into
mainfrom
chore/pliron-bump-823d9d8
Aug 29, 2026
Merged

nihalpasham merged 1 commit into
mainfrom
chore/pliron-bump-823d9d8

Conversation

@nihalpasham

Copy link
Copy Markdown
Collaborator

What this is

Bump pliron from 8447aa42 to upstream master 823d9d8 (6 commits). One commit matters to us, and it lets us delete code:

upstream pliron 8447aa42 ──► 823d9d8 (6 commits)
  #240 dedicated SyncScopeAttr        ◄── the only one with fallout
  #239 rename llvm.extract_elment     ── zero references in our tree
  #238 debug_info.rs move             ── we never import it
  #235 ScalarOrVector interfaces      ── internal upstream refactor
  #237 From<fmt::Error> for Error     ── additive
  #234 decontextualization utils      ── additive

The SyncScope migration

Until now cuda-oxide carried a local syncscope extension because pliron modeled the scope as a free-form Option<String>. Upstream's new SyncScopeAttr is a strict superset of it, so per the framework-first rule the shim is gone:

before:  llvm-export's local LlvmSyncScope enum ──► Option<String>
         (System | Device | Block)                  on every atomic op

after:   pliron's SyncScopeAttr ─────────────────► first-class attribute
         (System | SingleThread | NamedScope)       + SyncScopeInterface

emission unchanged:  atomicrmw add ... syncscope("device") monotonic
                     atomicrmw add ... syncscope("block") monotonic
  • llvm-export's exporter now reads scopes via SyncScopeInterface; mir-lower builds SyncScopeAttr directly; nvvm-transforms' legacy-atomic legalization matches on the attribute (SingleThread and unknown named scopes still rejected as unsupported, same as before).
  • Fence scope selection for the PTX membar path now keys off the NVVM-dialect scope enum directly instead of round-tripping through the deleted LLVM-level enum.
  • Bonus from upstream: the new ordering verifiers (fence not monotonic, cmpxchg-failure not release/acq_rel, atomic load/store ordering limits) now check our IR; every emission path already complies.

9 files, +151/−157.

Regression sweep: every example, before vs after

All 219 examples rebuilt on main and on this branch, device IR compared:

216 .ll pairs
  │  normalize build-identity noise (crate-disambiguator hashes,
  │  kernel emission order, _TID_/__shared_mem_N/__device_global_N/!N
  │  numbering that follows it)
  ▼
208 byte-identical as sets
  8 residual diffs ──► all numbering noise from build identity,
  ▼                    none caused by this bump
GPU execution (RTX 5090), branch build:
  all 6 atomic examples        ──► PASS  (atomics, atomic_f16,
                                          scoped_atomic_load_store,
                                          packed_atomic_add,
                                          legacy_atomic_fadd,
                                          legacy_atomic_rmw_cas)
  all 8 residual-diff examples ──► PASS  (numeric asserts)
  hashmap_v3 (15 tests)        ──► PASS, output byte-identical to main
  • syncscope emission histograms identical main vs branch: atomics 24 occurrences both sides, atomic_f16 4 both sides, same device/block mix.

Validation

  • cargo test --workspace: 101 suites, 5287 tests, 0 failures (on the branch rebased onto current main).
  • scripts/smoketest.sh --compile-only from a cold shared cache: 219/219 pass.
  • fmt + clippy clean on the touched crates (llvm-export, mir-lower, nvvm-transforms).
  • Example lockfiles untouched (device examples don't depend on pliron); the workspace locks pick up pliron's hashbrown 0.15→0.17 + foldhash 0.2 rides-along.

One behavior note for reviewers

Upstream's SyncScopeInterface::syncscope panics if the attribute is missing rather than returning a Result. Every cuda-oxide construction path goes through upstream constructors that always set it, and the interface verifier rejects IR without it, but raw Operation builders added in the future would hit the panic first.

Bump the pliron git pin 8447aa42 -> 823d9d8 in both manifests (workspace
and rustc-codegen-cuda, which must stay on the same rev) and refresh both
lockfiles.

Upstream pliron-llvm now models the synchronization scope of atomic ops
as a dedicated SyncScopeAttr (System / SingleThread / NamedScope) exposed
through a SyncScopeInterface, replacing the per-op optional StringAttr
(llvm_{rmw,cas,ld,st,fence}_syncscope) and the Option<String> constructor
parameters. That covers everything cuda-oxide's local LlvmSyncScope enum
existed for, so the local shim is deleted and all users migrate to the
upstream attribute:

- llvm-export: drop the LlvmSyncScope enum; the textual exporter reads
  scopes via SyncScopeInterface::syncscope and formats them with
  SyncScopeAttr::to_name (system scope stays unnamed).
- mir-lower: map NVVM scopes straight to SyncScopeAttr when building
  atomicrmw/cmpxchg; fence emission keys off the NVVM scope directly.
- nvvm-transforms: legacy legalization matches on SyncScopeAttr instead
  of Option<&str>; tests construct scopes through the attribute.

The upstream rename of llvm.insert_element/extract_element (op names
only, Rust types unchanged) and the other four commits in the range
(given_names rename, decontextualization utils, ScalarOrVector
interfaces, From<fmt::Error>) required no cuda-oxide changes.

Validated: cargo test --workspace (5287 passed, 0 failed), clippy clean
on touched crates, smoketest --compile-only 219/219, vecadd and
scoped_atomic_load_store executed on GPU; syncscope("device"/"block")
emission in generated .ll is unchanged.
@nihalpasham nihalpasham added build-related Build scripts, toolchain discovery, or compilation setup intrinsics Device intrinsics and libdevice math mappings llvm-export Textual LLVM/NVVM IR exporter (llvm-export crate) refactor Internal restructuring with no behavior change IR-lowering Lowering between dialects (dialect-mir to LLVM dialect) labels Aug 29, 2026
@nihalpasham
nihalpasham merged commit 224ae8d into main Aug 29, 2026
52 checks passed
@nihalpasham
nihalpasham deleted the chore/pliron-bump-823d9d8 branch September 5, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-related Build scripts, toolchain discovery, or compilation setup intrinsics Device intrinsics and libdevice math mappings IR-lowering Lowering between dialects (dialect-mir to LLVM dialect) llvm-export Textual LLVM/NVVM IR exporter (llvm-export crate) refactor Internal restructuring with no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant