Skip to content

✨ Add the MLIR compiler target foundation - #1993

Merged
burgholzer merged 6 commits into
mainfrom
agent/1687-ct-01-compiler-target
Aug 3, 2026
Merged

✨ Add the MLIR compiler target foundation#1993
burgholzer merged 6 commits into
mainfrom
agent/1687-ct-01-compiler-target

Conversation

@burgholzer

@burgholzer burgholzer commented Aug 3, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

Introduce the MLIR-owned mlir::CompilerTarget foundation for compiling
programs against concrete devices without coupling the compiler model to FoMaC,
QDMI, or the legacy CoreIR target.

The target is immutable and cheaply copyable. It validates and retains
provider-defined nonnegative site IDs, optional names and coherence times,
canonical undirected topology, ordered operation loci, optional calibration,
and typed native-gate capabilities. It caches dense site mappings, adjacency,
all-pairs distances, and a target-wide synthesis basis once at construction.
Absent topology means all-to-all connectivity; absent operations mean every
operation is native.

The standalone MQTCompilerTarget library links only MLIR/QCO infrastructure
and owns its public header in the build tree. Focused tests cover construction,
validation, topology/capability combinations, ordered loci, basis derivation,
QCO operation queries, and shared detached storage.

This is CT-01, the first compiler-side prerequisite in the compact
QDMI–Compiler integration series that will culminate in #1687. Relevant native
operation aliases derived from #1969 retain Simon Hofmann’s authorship in the
commit metadata.

This foundation is not independently user-facing, so its changelog coverage is
intentionally carried by the mapping, synthesis, and final integration PRs in
the series. No upgrade note is needed for the unreleased compiler collection.
The repository currently installs MQT MLIR archives without headers or CMake
exports; a complete installed MLIR C++ dependency closure and external consumer
test remain an explicit PIPE/INT series item instead of a partial CT-only rule.

Validation

  • Focused CompilerTargetTest.* suite
  • Compiler target and full compiler unittest build
  • Build-tree interface-header verification and component-install boundary probe
  • Full repository lint

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

Introduce an immutable, provider-independent target model with validated metadata, cached topology, native capability queries, and a typed synthesis basis.

Keep the foundation in a dependency-pure MLIR library and cover construction, validation, routing, gate orientation, and real QCO operations.

Co-authored-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-5.6 via Codex
@burgholzer burgholzer added feature New feature or request c++ Anything related to C++ code MLIR Anything related to MLIR skip-changelog Changes that do not need to show up in the changelog labels Aug 3, 2026
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mlir/lib/Compiler/Target.cpp 95.2% 19 Missing ⚠️

📢 Thoughts on this report? Let us know!

Move file-local helpers out of the anonymous namespace and give them explicit static linkage, matching the LLVM 22 lint contract without changing behavior.

Assisted-by: GPT-5.6 via Codex
@burgholzer burgholzer added this to the MLIR Support milestone Aug 3, 2026
@burgholzer burgholzer self-assigned this Aug 3, 2026
Store std::ranges results as iterator values instead of relying on libc++'s pointer-like std::array representation.

Assisted-by: GPT-5.6 via Codex
Use each array's const-iterator type explicitly so MSVC's iterator model and LLVM's qualified-auto rule are both satisfied without suppressions.

Assisted-by: GPT-5.6 via Codex
Deduce range-result iterators so MSVC retains its class iterator while libc++ can expose a pointer. Suppress only the two contradictory qualified-auto diagnostics and keep modernize-use-auto enabled.

Assisted-by: GPT-5.6 via Codex
@burgholzer
burgholzer merged commit f775395 into main Aug 3, 2026
33 checks passed
@burgholzer
burgholzer deleted the agent/1687-ct-01-compiler-target branch August 3, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code feature New feature or request MLIR Anything related to MLIR skip-changelog Changes that do not need to show up in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant