Add SCF support to WireIterator#1806
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
📝 WalkthroughWalkthrough
ChangesWireIterator SCF traversal refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🤖 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/lib/Dialect/QCO/Utils/WireIterator.cpp`:
- Around line 134-145: In the backward() method's qco::IfOp case, fix the mixed
iterator sources by replacing the llvm::find and std::distance calls with
getResults().begin() and getResults().end() to match the forward() method's
pattern for the same qco::IfOp case. Correct the assertion's result_end() call
from arrow notation (op->result_end()) to dot notation (op.result_end()) to
properly access the Operation members. Finally, update the error message in the
llvm::reportFatalInternalError call from "expected scf.for result for tied init
lookup" to reference qco.if instead of scf.for.
🪄 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: 8f75e50f-3377-4108-8602-ca040e5d2c9e
📒 Files selected for processing (4)
CHANGELOG.mdmlir/include/mlir/Dialect/QCO/Utils/WireIterator.hmlir/lib/Dialect/QCO/Utils/WireIterator.cppmlir/unittests/Dialect/QCO/Utils/test_wireiterator.cpp
Changes
✨Add SCF op switch cases in
WireIterator.cppand add unit tests(Extracted from #1805 to decrease that PR size and ease reviewing)
Checklist
If PR contains AI-assisted content:
Assisted-by: [Model Name] via [Tool Name]footer.