Fix scf.for loop-carried memref reconciliation#262
Closed
HecreReed wants to merge 2 commits into
Closed
Conversation
Zhendong404
pushed a commit
to Zhendong404/PTOAS
that referenced
this pull request
May 17, 2026
* Add OP for TMrgSort * Add OP for TMrgSort | fix review * Add constraints to tmov template for UB2UB ND2ND only Add constraint function to restrict template_tmov_basic to only support: - UB2UB: Both src and dst must be in Unified Buffer (memory_space="ub") - ND2ND: Both tiles must have N-dimensional layout (s_layout=NONE_BOX) Other scenarios (GM2UB, UB2GM, specialized layouts) require different implementation paths and are explicitly rejected by this constraint. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: caojian5 <caojian5@huawei.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scf.forloop-carried iter_arg/result types afterPTOViewToMemrefrewrites tile values to memrefs.ptoregression for loop-carriedtile_bufvaluesqwen3_decode_layer_incore_0.ptonow compiles on top oforigin/mainRoot cause
PTOViewToMemrefalready had a post-rewrite fixup forscf.if, but not forscf.for. When loop-carriedtile_bufvalues were rewritten to memrefs inside the loop body, the pass left thescf.forinit operand, region iter_arg, yield operand, and op result out of sync.Verification
cmake --build /tmp/ptoas-qwen-repro.oy3rK0/build-fix --target ptoas -j8ptoas /tmp/ptoas-qwen-repro.oy3rK0/fix-branch/test/basic/scf_for_tile_iter_arg_reconcile.pto 2>&1 1>/dev/null | FileCheck /tmp/ptoas-qwen-repro.oy3rK0/fix-branch/test/basic/scf_for_tile_iter_arg_reconcile.ptoptoas /Users/laoda/Downloads/qwen3_decode_layer_incore_0.pto -o /tmp/qwen-fix.cpp