Skip to content

Migrate LLVM inline asm semantics to upstream Pliron attributes #1308

Closed

Description

@uurl

Context

cuda-oxide currently carries private inline-asm semantic attributes for concepts that are now modeled directly by pliron-llvm.

Pliron PR pliron-org/pliron#253 added upstream LLVM inline-asm support for:

  • llvm_inline_asm_side_effects
  • llvm_inline_asm_attrs
  • generic LLVM call-site attributes such as convergent

This makes the cuda-oxide-specific representations redundant.

There is also a semantic compatibility hazard when updating Pliron: the final bool argument of InlineAsmOp::new now represents side_effects, whereas the previous API used that position for convergent. Updating the dependency without migrating the call sites can therefore compile while silently changing semantics.

Proposed change

Migrate cuda-oxide inline asm modeling to the upstream Pliron representation:

  • keep AsmKind only as a cuda-oxide builder/convenience classification;
  • stop persisting cuda_oxide_asm_kind;
  • use llvm_inline_asm_side_effects for LLVM sideeffect;
  • use llvm_inline_asm_attrs with the convergent unit attribute for convergent inline asm;
  • update the LLVM exporter to consume the upstream attributes directly;
  • update inline PTX lowering and tests to use the upstream generated accessors;
  • remove the private cuda_oxide_inline_asm_sideeffect representation.

The Pliron dependency update also requires mechanical compatibility changes for APIs that changed in the same upstream revision, including generated LLVM attribute accessors and AllocaOp::new.

Acceptance criteria

  • No production use of cuda_oxide_asm_kind.

  • No production use of cuda_oxide_inline_asm_sideeffect.

  • No use of the old inline-asm generated accessors:

    • get_attr_inline_asm_template
    • get_attr_inline_asm_constraints
    • get_attr_inline_asm_convergent
  • Existing inline PTX semantics are preserved for all four AsmKind combinations:

    • convergent + side-effecting
    • convergent + pure
    • non-convergent + side-effecting
    • non-convergent + pure
  • LLVM export continues to emit the correct sideeffect and convergent semantics.

  • Workspace tests, Clippy, formatting, and just check pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions