Repository navigation
refactor(llvm): use upstream inline asm semantics - #1309
Merged
Merged
Conversation
uurl
force-pushed
the
refactor/llvm-inline-asm-upstream
branch
from
September 19, 2026 23:33
c8c279a to
f809f6d
Compare
Signed-off-by: Raul Estrada <[email protected]>
Signed-off-by: nihalp <[email protected]>
nihalpasham
force-pushed
the
refactor/llvm-inline-asm-upstream
branch
from
September 23, 2026 06:12
f809f6d to
85eb881
Compare
nihalpasham
approved these changes
Sep 23, 2026
nihalpasham
left a comment
Collaborator
There was a problem hiding this comment.
I kept the dependency and constructor migration together, and added one exporter check for the new generic attribute container. The four existing inline-asm combinations remain supported; attributes such as noduplicate now produce a clear error instead of silently disappearing, and convergent requires its unit form.
The added tests exercise upstream constructors and verifier-valid unsupported attributes. just check passes with 5,425 tests/doctests. The inline-PTX and barrier examples also pass on RTX 5090, with clean memcheck/synccheck. All seven hosted workflows passed at 85eb881c.
This addresses #1308 within the existing inline-asm attribute scope.
This was referenced Sep 23, 2026
pifu-zh
added a commit
to pifu-zh/cuda-oxide
that referenced
this pull request
Oct 6, 2026
…4 restored) Rebase onto upstream ec4aa47 (74 commits) changed the exported .ll shapes; four adaptations, each semantics-preserving: - Step 4: tid.y/tid.z -> llvm.amdgcn.workitem.id.y/z (upstream NVIDIA#1311 computes in-block rank via 3-D coords; on 1-D launches both sides return 0). Declares added to the mapped-strip list. - Step 10: accept dynamic membermask ((1<<live)-1 from the partial-warp collectives) and clamp=0 for .up (PTX clamp is the min-source-lane bound for .up; ds_bpermute's data movement is mask-independent and the convergent marker carries the all-lanes-execute requirement). - Step 12d: parse asm operands with top-level comma splitting - NVIDIA#1327 packed-as3 emits constant-expression pointers (ptr addrspacecast (ptr addrspace(3) @sym to ptr)) that the old [^,)] captures could not span. - Step 12e: panic trap is now inline PTX asm "trap;" (NVIDIA#1309) which the AMDGPU backend rejects; map to llvm.trap() (lowers to s_trap). Batch tool: select artifacts by exact name - the old "*.opt.ll" glob also matched the integrated pipeline's leftover *.amdgcn.preopt.opt.ll (sorted first), so the Python dimension double-rewrote the wrong file; the recorded 9/17 was measurement poisoning as much as shape drift. Verified: batch 14/14 llc-pass; tests/test_gfx1030.py 14 passed.
pifu-zh
added a commit
to pifu-zh/cuda-oxide
that referenced
this pull request
Oct 6, 2026
…tions Mirror of the Python-pipeline adaptation (35bed77) on the integrated path, for the two shapes the Rust prep pass also meets: - Step 10 envelope: dynamic membermask accepted (upstream NVIDIA#1311 partial-warp collectives emit (1<<live)-1 as SSA; ds_bpermute's data movement is mask-independent, convergent survives), and .up clamp=0 accepted (PTX clamp bounds the lowest source lane for .up; the other modes keep width-1=31). Literal non-(-1) masks still fall through for llc to reject explicitly. - Step 12e: panic trap is inline PTX asm post-NVIDIA#1309 and the AMDGPU backend rejects the mnemonic; map the exact shape to llvm.trap() (s_trap on gfx1030). 12d's store/load operand parsing already handled NVIDIA#1327 constant- expression pointers via split_top_level_commas (no change needed). Verified: dynamic-mask up@0 + trap-asm unit tests; lib 1252 green.
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.
What this fixes
Inline assembly now stores its side effects and convergence using upstream Pliron attributes. The dependency update and all constructor migrations are kept together because the final
InlineAsmOp::newboolean changed from convergence to side effects.AsmKindremains a convenience builder/query for the four supported combinations. LLVM export reads the upstream representation directly.Maintainer follow-up
The upstream generic attribute container accepts more than this exporter implements. Added one shared check so the exporter and classification query accept absent attributes or unit
convergent, and report unsupported names or value forms. Attributes such asnoduplicatemust not silently disappear.Verification
noduplicate, integer-valuedconvergent, and string-valuedconvergentare rejected with precise diagnostics.just checkpassed: 5,425 tests/doctests, formatting, strict Clippy, repository/license guards, intrinsic checks and warning-free docs. The suite intentionally ignored 168 tests/doctests.inline_ptxandbarrierpassed. Inline PTX memcheck and barrier synccheck report zero errors.85eb881c.Supported scope
This migrates existing inline-asm semantics. It does not implement arbitrary generic LLVM function/call-site attributes.
Closes #1308 within the existing inline-asm attribute scope.