Skip to content

🚛 Move mapping pass files to QCO/Transforms#1547

Merged
burgholzer merged 4 commits intomainfrom
enh/canonical-folder-structure
Mar 10, 2026
Merged

🚛 Move mapping pass files to QCO/Transforms#1547
burgholzer merged 4 commits intomainfrom
enh/canonical-folder-structure

Conversation

@MatthiasReumann
Copy link
Copy Markdown
Collaborator

@MatthiasReumann MatthiasReumann commented Mar 10, 2026

Description

This pull request moves the recently added mapping pass .cpp and .h files to QCO/Transforms/Mapping and adjusts the respective CMakeLists.txt files accordingly.

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.

Comment thread mlir/unittests/Dialect/QCO/Transforms/Mapping/CMakeLists.txt Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a3d9e16c-0582-436f-91bf-69b559b83406

📥 Commits

Reviewing files that changed from the base of the PR and between 0a95157 and 984d3dd.

📒 Files selected for processing (3)
  • mlir/include/mlir/Dialect/QCO/Transforms/CMakeLists.txt
  • mlir/lib/Dialect/QCO/Transforms/CMakeLists.txt
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/CMakeLists.txt

📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Reorganized QCO transform components into a dedicated Transforms module and removed the global Passes component from top-level build.
  • Chores

    • Updated internal references and unit-test linkage to align with the new Transforms layout.
    • Updated the changelog to add an additional PR reference for the place-and-route pass.

Walkthrough

Move QCO pass sources/headers into mlir/Dialect/QCO/Transforms: remove top-level Passes subdirs from global build/test CMake files, add Transforms subdirs to QCO CMake files, update include paths, rename generated tablegen targets, and adjust test target linkages and changelog PR references.

Changes

Cohort / File(s) Summary
Root CMake Build Configuration
mlir/include/mlir/CMakeLists.txt, mlir/lib/CMakeLists.txt, mlir/unittests/CMakeLists.txt
Removed top-level additions of the generic Passes subdirectory so the global build/test scopes no longer include that Passes module.
QCO Dialect CMake Build Configuration
mlir/include/mlir/Dialect/QCO/CMakeLists.txt, mlir/lib/Dialect/QCO/CMakeLists.txt, mlir/unittests/Dialect/QCO/CMakeLists.txt
Added Transforms subdirectory to QCO dialect CMake files so QCO transforms are configured/built within the dialect tree.
QCO Transforms Public & TableGen Targets
mlir/include/mlir/Dialect/QCO/Transforms/CMakeLists.txt, mlir/lib/Dialect/QCO/Transforms/CMakeLists.txt
Renamed tablegen target and public target references from QcoPasses*MLIRQCOTransforms*, updated DEPENDS and header globs to mlir/Dialect/QCO/Transforms/*, and adjusted doc group name.
Transforms Generated Includes
mlir/include/mlir/Dialect/QCO/Transforms/Passes.h
Switched generated include paths from mlir/Passes/Passes.h.inc to mlir/Dialect/QCO/Transforms/Passes.h.inc for GEN_PASS_DECL/REGISTRATION.
Transforms Implementation Sources
mlir/lib/Dialect/QCO/Transforms/Mapping/Architecture.cpp, mlir/lib/Dialect/QCO/Transforms/Mapping/Mapping.cpp
Updated include directives to use dialect-specific transform headers (e.g., mlir/Dialect/QCO/Transforms/...) and adjusted generated include to the dialect-specific Passes.h.inc.
Transforms Tests
mlir/unittests/Dialect/QCO/Transforms/Mapping/CMakeLists.txt, mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp
Added MLIRQCOUtils and MLIRQCOTransforms to the test target's PRIVATE link libraries and updated test includes to use mlir/Dialect/QCO/Transforms/... paths.
Changelog
CHANGELOG.md
Added PR reference [#1547] to the Unreleased Added entry and inserted the PR link into the PR links section.

Sequence Diagram(s)

(omitted — changes are build and include reorganization without a multi-component sequential runtime flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • burgholzer
  • denialhaag

Poem

🐰
I hopped through CMake, moved files with care,
Passes found a den in QCO's lair.
Headers snug in a tidy little bed,
Transforms now flourish where they were led.
Carrots crunch — the build hums ahead.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly summarizes the main change: moving mapping pass files to the QCO/Transforms directory structure.
Description check ✅ Passed The description clearly explains the purpose (moving files) and mentions CMakeLists.txt adjustments, with all checklist items marked complete.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enh/canonical-folder-structure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mlir/lib/Dialect/QCO/CMakeLists.txt`:
- Line 11: The install/export header globs for the QcoPasses target were not
updated after moving headers into mlir/lib/Dialect/QCO/Transforms, so QcoPasses
will miss those headers; open mlir/lib/Dialect/QCO/Transforms/CMakeLists.txt and
update the QcoPasses PUBLIC_HEADER (or the install/export header list) to
include the relocated patterns (e.g., add mlir/Dialect/QCO/Transforms/*.h and
*.inc or adjust the existing mlir/Passes/*.h and *.inc globs) so the
installed/exported QcoPasses target contains the new header locations and
rebuilds/install will export them correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 150b5555-aa2d-4456-ab47-04040f84ea9f

📥 Commits

Reviewing files that changed from the base of the PR and between d8f551d and ac08764.

📒 Files selected for processing (16)
  • mlir/include/mlir/CMakeLists.txt
  • mlir/include/mlir/Dialect/QCO/CMakeLists.txt
  • mlir/include/mlir/Dialect/QCO/Transforms/CMakeLists.txt
  • mlir/include/mlir/Dialect/QCO/Transforms/Mapping/Architecture.h
  • mlir/include/mlir/Dialect/QCO/Transforms/Passes.h
  • mlir/include/mlir/Dialect/QCO/Transforms/Passes.td
  • mlir/lib/CMakeLists.txt
  • mlir/lib/Dialect/QCO/CMakeLists.txt
  • mlir/lib/Dialect/QCO/Transforms/CMakeLists.txt
  • mlir/lib/Dialect/QCO/Transforms/Mapping/Architecture.cpp
  • mlir/lib/Dialect/QCO/Transforms/Mapping/Mapping.cpp
  • mlir/unittests/CMakeLists.txt
  • mlir/unittests/Dialect/QCO/CMakeLists.txt
  • mlir/unittests/Dialect/QCO/Transforms/CMakeLists.txt
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/CMakeLists.txt
  • mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp
💤 Files with no reviewable changes (3)
  • mlir/unittests/CMakeLists.txt
  • mlir/lib/CMakeLists.txt
  • mlir/include/mlir/CMakeLists.txt

Comment thread mlir/lib/Dialect/QCO/CMakeLists.txt
Copy link
Copy Markdown
Member

@denialhaag denialhaag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a lot! 🙂

Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! Looks great to me. I added a suggestion on the target naming, which might make sense to still target as part of this PR

Comment thread mlir/unittests/Dialect/QCO/Transforms/Mapping/CMakeLists.txt Outdated
@burgholzer burgholzer added refactor Anything related to code refactoring c++ Anything related to C++ code MLIR Anything related to MLIR labels Mar 10, 2026
@burgholzer burgholzer added this to the MLIR Support milestone Mar 10, 2026
Copy link
Copy Markdown
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go 🚀

@burgholzer burgholzer enabled auto-merge (squash) March 10, 2026 12:13
@burgholzer burgholzer merged commit 6b208c4 into main Mar 10, 2026
34 checks passed
@burgholzer burgholzer deleted the enh/canonical-folder-structure branch March 10, 2026 12:24
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 MLIR Anything related to MLIR refactor Anything related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants