llvm-project
e32ffd8b - [CIR] Add offload container attribute (#206576)

Commit
30 days ago
[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)
Author
Parents
Loading