已合并
【质量加固】style: autofuse 仅补齐10处 const 规范 #1787
QWH456123创建于 4 天前
【质量加固】style: autofuse 仅补齐10处 const 规范 #1787
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 QWH456123 的贡献)atomgit-bot
4 天前 评论:
4 天前 评论:
变更摘要
本 PR 对应质量加固 Issue #238,仅在 autofuse/ 目录内做 const 相关代码规范修复,共 10 处:为 NameGenerator、TilingData 的多个成员函数补充 const 限定(同步修改 .h 声明与 .cpp 实现),将 IrAttrHandleMap 改为 const 容器并将查找方式由 operator[] 改为 .at(),同时把多处循环迭代变量与局部变量补充 const。PR 明确不涉及参数名重命名、非 const 相关逻辑及 CI / super_kernel 变更,不引入行为变化。
主要改动
- 成员函数补充
const限定:TilingData::GenConstGenResultReplace()、GenTingDataField()、GetNameOfGenTilingDataFieldConstDefFunc()、GetNameOfGenTilingDataFieldConstDefFuncSimple()、GetNameOfGenTilingDataFieldConstValueFuncSimple()及NameGenerator::GetNameMapping()均加上const,并在codegen_tiling_data.h、ascend_graph_code_dumper.h中同步更新声明。 IrAttrHandleMap改为const并改用.at(): 在ascend_graph_code_dumper.cpp中将该 map 声明为const,属性处理函数调用由IrAttrHandleMap[attr_def.asc_ir_type]改为IrAttrHandleMap.at(...)。- 循环迭代改为
const auto &:GetOutputName遍历ir_output_2_ranges以及GenConstGenResultReplace()、GenTingDataField()、GetNameOfGenTilingDataFieldConstDefFunc()遍历容器时,迭代变量由值拷贝改为const auto &,避免不必要的拷贝。 - 局部变量补充
const:binary_api_tmp_call.cpp中的x1_idx/x2_idx与pad_api_call.cpp中的axis_num均声明为const局部变量。


atomgit-bot
4 天前 评论:
4 天前 评论:
4 天前 添加了label:cann-cla/yes
CANN-robot
4 天前 评论:
4 天前 评论:
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.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/graph-autofusion | ✅ 张德鹏, niuyuhu, xchu42 (3/2) | ✅ 张德鹏 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
QWH456123, thanks for your pull request. All authors of the commits have signed the CLA. 👍


4 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
4 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为评审人
4 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
4 天前 将niuyuhu,yangyongqiang0606,liyuewei,xchu42,zhang_shengjie,depeng1994,wqtshg_wt,peiyang,shengnan666,XuebinYang,sjtulxh,zhanj,zhujingjing,xuyafei,wangxiaotian995设为审查人
4 天前 添加了label:ci-pipeline-running
CANN-robot
4 天前 评论:
4 天前 评论:
流水线任务触发成功
任务链接 [3223cf50dc9e4219928692e06baf1392][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| UT_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| ST_Test_Python_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_superkernel | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_framework | ✅ SUCCESS | >>>>> | |
| UT_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_ascendc_api | ✅ SUCCESS | >>>>> | |
| ST_Test_autofuse_e2e | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_Report | ✅ SUCCESS | >>>>> | |
| ST_Test_Report | ✅ SUCCESS | >>>>> |
[2026-08-20 14:29:35] CI执行结束


CANN-robot
4 天前 评论:
4 天前 评论:
CANN-robot
4 天前 评论:
4 天前 评论:
4 天前 删除了label:ci-pipeline-running
4 天前 添加了label:ci-pipeline-passed
QWH456123
4 天前 评论:
4 天前 评论:
QWH456123
4 天前 评论:
4 天前 评论:
牛玉虎
4 天前 评论:
4 天前 评论:
/lgtm


4 天前 通过了评审
4 天前 通过审查
QWH456123
4 天前 评论:
4 天前 评论:
QWH456123
4 天前 评论:
4 天前 评论:
QWH456123
4 天前 评论:
4 天前 评论:
xchu42
4 天前 评论:
4 天前 评论:
/lgtm


4 天前 添加了label:lgtm
4 天前 添加了label:approved
4 天前 合入了pull request
Pull Request
描述
对应 Issue #238「质量加固」。
本 PR 仅做 const 相关规范修复,共 10 处;不改参数名、不改非 const 相关逻辑;仅
autofuse/,无 CI /super_kernel变更。变更类型
关联的Issue
Issue 地址:https://gitcode.com/cann/graph-autofusion/issues/238
修改清单(10处,均为 const)
NameGenerator::GetNameMapping()加constTilingData::GenConstGenResultReplace()加constTilingData::GenTingDataField()加constGetNameOfGenTilingDataFieldConstDefFunc()加constGetNameOfGenTilingDataFieldConstDefFuncSimple()加constGetNameOfGenTilingDataFieldConstValueFuncSimple()加constIrAttrHandleMap改为const,查找改用.at()GetOutputName循环改为const auto &binary_api_tmp_call.cpp:x1_idx/x2_idx加constpad_api_call.cpp:axis_num加const刻意未改(降风险)
const AscNode &一类易触发outputs非 const 接口的改动如何测试
compile核对清单