[Codecheck]refactor: split nbnc hotspot files#701
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the codebase by moving large implementation blocks from source and header files (SyncSolver.cpp and ptobc_opcodes_v0.h) into separate definition files (SyncSolver.def and ptobc_opcodes_v0.def) and including them. Feedback points out that ptobc_opcodes_v0.h is missing #pragma once or header guards, which could lead to multiple inclusion issues, and suggests updating the generator script to target the .def file directly.
| } | ||
|
|
||
| } // namespace ptobc::v0 | ||
| #include "ptobc_opcodes_v0.def" |
There was a problem hiding this comment.
The header file ptobc_opcodes_v0.h is missing #pragma once or header guards, which can lead to multiple inclusion issues. Additionally, this file is generated by docs/bytecode/tools/gen_v0_tables.py. The generator script should be updated to output to ptobc_opcodes_v0.def instead of ptobc_opcodes_v0.h to prevent future runs from overwriting this file and reverting the refactoring.
| #include "ptobc_opcodes_v0.def" | |
| #pragma once\n#include \"ptobc_opcodes_v0.def\" |
Codex Review该评论由 review 机器人自动更新。
Summary未检查到 PR #701 存在问题 FindingsNo issues found. |
This reverts commit 17080f6.
|
/review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ce0de3707
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (v == 0xFFFF) return std::nullopt; | ||
| return v; | ||
| } | ||
| extern const OpInfo kOpTable[]; |
There was a problem hiding this comment.
Keep opcode table visible to coverage checker
Replacing the inline kOpTable definition with an extern declaration means the header no longer contains any {0x..., "op"} entries, but tools/ptobc/tests/opcode_coverage_check.py (invoked by ptobc_opcode_coverage_check in tools/ptobc/tests/CMakeLists.txt) still parses this header text to validate opcode coverage. After this refactor the checker sees no table rows in the header, so this test no longer validates the generated opcode map and can miss opcode-table regressions.
Useful? React with 👍 / 👎.
Manual Codex Review该评论由
Summary收到 FindingsReview in progress. |
Manual Codex Review该评论由
Summaryptobc opcode table splitting regresses the existing coverage check: CI still scans the header, but the actual table moved into the new .cpp file. Findings
This refactor moves the opcode table and lookup implementations out of |
|
/run a3 |
|
已接收
页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。 |
A3 板测失败
失败用例
|
A3 板测失败详情:PR #701syncall_binding
tprefetch_async_binding
|
Summary
Rework the NBNC cleanup as real source decomposition. The earlier
.definclude-only approach was reverted.Resolved in this branch:
tools/ptobc/generated/ptobc_opcodes_v0.h: split declarations into the header and definitions into compiledptobc_opcodes_v0.cpp.lib/PTO/Transforms/GraphSyncSolver/SyncSolver.cpp: split merge/backward-sync logic into compiledSyncSolverMerge.cpp.lib/PTO/Transforms/PTOViewToMemref.cpp: split compute-op rewrite stage into compiledPTOViewToMemrefCompute.cpp.In progress:
lib/PTO/Transforms/PTOToEmitC.cpp: Arith/Affine conversion patterns are now in compiledPTOToEmitCArith.cpp; more PTO op pattern groups still need to be split.Remaining hotspots:
lib/PTO/IR/PTO.cpplib/PTO/Transforms/PTOToEmitC.cppCurrent NBNC snapshot:
SyncSolver.cpp: 1620SyncSolverMerge.cpp: 646PTOViewToMemref.cpp: 1466PTOViewToMemrefCompute.cpp: 1419ptobc_opcodes_v0.h: 48ptobc_opcodes_v0.cpp: 657PTOToEmitC.cpp: 9112PTO.cpp: 11280Validation
cmake -G Ninja -S . -B /tmp/ptoas-nbnc-build -DLLVM_DIR=/Users/laoda/llvm-workspace/llvm-project/llvm/build-shared/lib/cmake/llvm -DMLIR_DIR=/Users/laoda/llvm-workspace/llvm-project/llvm/build-shared/lib/cmake/mlir -DCMAKE_BUILD_TYPE=Release -DPTO_ENABLE_PYTHON_BINDING=OFFninja -C /tmp/ptoas-nbnc-build ptoas ptobcninja -C /tmp/ptoas-nbnc-build check-pto(244/244 passed)Notes
Draft status is intentional until
PTO.cppand the remainingPTOToEmitC.cpppattern groups are split below the NBNC thresholds.