✨ Map scf::WhileOps using the restore strategy - #1911
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp`:
- Around line 107-127: Update the initialization in the mapping test around
initArgs, initialHardwareOrder, and localM so SCF hardware indices are derived
from qubit-only init operands, matching the filtered qubitArgs order. Filter
scf::WhileOp getInits() and scf::ForOp getInits() by QubitType before mapping
through m, while preserving qco::IfOp behavior and ensuring mixed-type loops do
not access missing DenseMap entries.
- Line 738: Add routing-relevant gates to the while after-region test around the
identity callback in the mapping test, so recursive after-region routing and
terminator realignment are exercised. Extend the test inputs and assertions to
verify the mapped values and control flow remain correctly aligned through the
after-region rather than merely returning args unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ce75cc65-da3f-4bff-a384-61ca652f1b74
📒 Files selected for processing (4)
mlir/include/mlir/Dialect/QCO/Utils/Drivers.hmlir/lib/Dialect/QCO/Transforms/Mapping/Mapping.cppmlir/lib/Dialect/QCO/Utils/WireIterator.cppmlir/unittests/Dialect/QCO/Transforms/Mapping/test_mapping.cpp
burgholzer
left a comment
There was a problem hiding this comment.
I haven't scrutinized every single detail here, but this looks good except for the conflicts that need to be addressed. Afterwards, this can go in.
Description
This pull request adds mapping support for the
scf::WhileOp.scf::WhileOpto supported SCF ops inMapping.cppscf::WhileOpisExecutablefunction intest_mapping.cppdispatchfunction inMapping.cppChecklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).Assisted-by: [Model Name] via [Tool Name]footer.