Pull Request已成功合入, 合并人@chenwenqiao
(感谢 hujiajun 的贡献)libing-pipeline创建中,请等待……


Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/AscendNPU-IR | ❌ (0/2)(You can also ask: 杨开昕, solin205, Zackc, yue-xy, bryanpkc) | ❌ (0/1)(You can also ask: shijingchang, baberrehman, michael_hliao, YaoqingGao, 周浩) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Hu_JJN, thanks for your pull request. All authors of the commits have signed the CLA. 👍


✅ The pipeline is running (pipeline number: 113), Task URL link, please wait a moment ...


变更摘要
此 PR 旨在 revert PR #1333,核心目的是防止 VFFusion 过程中因跨 anchor 融合而破坏 anchor 顺序。主要策略是:将 AnchorOp 视为融合屏障(barrier),在融合分析的遍历过程中遇到 AnchorOp 时立即中断遍历;同时调整了 anchor 插入的默认策略,由原来仅对 cube ops 插入 anchor 改为对 cube 和 vector ops 均插入 anchor。
主要改动
-
AutoVectorizeV2.cpp融合屏障逻辑:在computeConflictLists的遍历回调中新增对hivm::AnchorOp的判断——当遇到AnchorOp时返回WalkResult::interrupt(),从而阻止融合 pass 跨越 anchor 边界移动 region-bearing ops,保护 anchor 的顺序不被破坏。 -
Passes.td默认选项调换:insertAnchorOnlyBeforeCubeOps默认值由true改为false,insertAnchorBeforeCubeAndVectorOps默认值由false改为true,使得默认行为从"仅对 cube ops 前插入 anchor"切换为"对 cube 和 vector ops 前均插入 anchor"。 -
测试用例
hivm-insert-anchors-and-backup-2.mlir删除:该文件(120 行)专门测试insert-anchor-only-before-cube-ops=true的旧默认模式,因旧默认已被废弃而整体移除。 -
测试用例
hivm-insert-anchors-and-backup.mlirRUN 行简化:移除显式指定的三个选项参数,改为直接使用--hivm-insert-anchors-and-backup,依赖新的默认值(insert-anchor-before-cube-and-vector-ops=true)运行。


ascend docs pipeline is running...


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 恶意代码检查 | Antipoison | ❌ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| 流水线 | PR-pipeline_ascendnpu-ir-A5-copy | ❌ | >>> |
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


✅ 跳过 docs ci 检查,没有需要检查的文档文件


代码审查
经过对所有四个变更文件(含一个被删除文件)的逐一审查,本 diff 未发现正确性、安全性、可靠性或回归问题。变更分析如下:
-
Passes.td:将
insertAnchorOnlyBeforeCubeOps默认值从true改为false,insertAnchorBeforeCubeAndVectorOps从false改为true。这是对 PR #1333 的有意回退,恢复"cube+vector"为默认 anchor 插入模式。InsertAnchorsAndBackup.cpp中的选项处理逻辑(级联 if 检查)与新默认值兼容。 -
AutoVectorizeV2.cpp:在
computeConflictLists的 walker lambda 中新增AnchorOp检查(第 533-534 行)。当 region-bearing op 内部包含 anchor 时,walker 返回interrupt(),触发全屏障——将所有前驱和后继可融合 op 标记为冲突。这与MergeVecScope.cpp中已有的containsAnchor模式一致,正确实现了"内部有 anchor 则视为 barrier"的语义。 -
hivm-insert-anchors-and-backup-2.mlir(已删除):该测试文件覆盖
insert-anchor-only-before-cube-ops=true模式。作为 PR #1333 回退的一部分被删除。"cube only"模式仍为有效选项但不再是默认值。 -
hivm-insert-anchors-and-backup.mlir:RUN 行从显式 pipeline flag 简化为
--hivm-insert-anchors-and-backup,依赖新默认值。新旧配置等价,测试预期输出不变。
总结:0 个 finding,整体风险低。变更意图明确(回退 + 屏障修复),实现与现有代码模式一致。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


libing-pipeline创建中,请等待……


✅ The pipeline is running (pipeline number: 115), Task URL link, please wait a moment ...


ascend docs pipeline is running...


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 恶意代码检查 | Antipoison | ❌ | >>> |
| 编码安全与规范检查 | CodeCheck | ❌ | >>> |
| 流水线 | PR-pipeline_ascendnpu-ir-A5-copy | ❌ | >>> |
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


✅ 跳过 docs ci 检查,没有需要检查的文档文件


描述 Description
revert pr1333,为了避免fusion破坏anchor顺序,如果一个egion-bearing op内部存在anchor,则将其视为barrier,不对其上下的op做融合。
类型 Category
Checklist
feat:,fix:)I have correctly used type labels in the title (e.g., feat:, fix:)