[all-commits] [llvm/llvm-project] e32ffd: [CIR] Add offload container attribute (#206576)

David Rivera via All-commits all-commits at lists.llvm.org
Wed Sep 9 20:24:27 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e32ffd8b546f4a743812756efe11a7424cf9de5f
      https://github.com/llvm/llvm-project/commit/e32ffd8b546f4a743812756efe11a7424cf9de5f
  Author: David Rivera <davidriverg at gmail.com>
  Date:   2026-09-09 (Wed, 09 Sep 2026)

  Changed paths:
    M clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
    M clang/include/clang/CIR/Dialect/IR/CIRDialect.td
    M clang/lib/CIR/Dialect/IR/CIRDialect.cpp
    A clang/test/CIR/IR/invalid-offload-container.cir
    A clang/test/CIR/IR/offload-container.cir

  Log Message:
  -----------
  [CIR] Add offload container attribute (#206576)

Introduce `cir.offload.container`, a CIR dialect unit attribute that marks an
MLIR module as holding a host CIR module and its associated device CIR
modules in one IR unit while later offload merge/split pipeline passes need
visibility into both sides.

The marked module's body holds nested `builtin.module` operations. Each
nested module is tagged with `cir.offload.kind`, represented by the new
`#cir.offload_kind<host>` / `#cir.offload_kind<device>` enum attribute.

The structural contract expected by the follow-up pipeline work is
enforced in `CIRDialect::verifyOperationAttribute`, following the
`gpu.container_module` precedent:

* `cir.offload.container` is a unit attribute attached to a
`builtin.module`
* the first nested module is the host module
* all following nested modules are device modules
* the body contains only nested `builtin.module` operations
* at least one device module is present
* `cir.offload.kind` is only ever attached to a `builtin.module`

This patch only introduces the IR representation and verifier tests. The
passes that create, consume, or split this container are left to follow-up
patches.

This is part of the Host-Device CIR Combine Pipeline work discussed on
Discourse:
[discourse.llvm.org/t/gsoc-2026-host-device-cir-combine-pipeline-project-idea-discussion/89623](https://discourse.llvm.org/t/gsoc-2026-host-device-cir-combine-pipeline-project-idea-discussion/89623)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list