Remove unused constant definitions and related includes from asm_constants - #238
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR removes the shared asm_constants header/implementation and inlines the few remaining VPU constant vectors directly at their use sites, reducing cross-module dependencies.
Changes:
- Removed
lib_nn/src/asm/asm_constants.handlib_nn/src/asm/asm_constants.cand their remaining includes. - Inlined VPU constant vectors into
add_elementwise.S(assembly) andadd_elementwise_ref()(C reference implementation). - Tightened internal linkage in
add_elementwise.cby makingmkmsk()static.
File summaries
| File | Description |
|---|---|
| lib_nn/src/cpp/OutputTransformFn.cpp | Drops unused asm_constants include from the C++ VPU simulation path. |
| lib_nn/src/c/add_elementwise.c | Removes external constant dependency; inlines vector constant and makes helper static. |
| lib_nn/src/asm/stubs.c | Drops unused asm_constants include from VX4 stub build. |
| lib_nn/src/asm/asm_constants.h | Deleted unused constants header. |
| lib_nn/src/asm/asm_constants.c | Deleted unused constants implementation. |
| lib_nn/src/asm/add_elementwise.S | Inlines vector constants and updates loads to use local labels. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xalbertoisorna
requested review from
LeslieXMOS and
uvvpavel
and
a lite review from Copilot
September 1, 2026 10:56
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
lib_nn/src/c/add_elementwise.c:54
- Comment text is unclear/abbreviated (“vect”). Consider using “vector” (and optionally clarify its purpose/value) to make the intent obvious to readers.
// Constant vpu vect
- Files reviewed: 6/6 changed files
- Comments generated: 0 new
- Review effort level: Lite
uvvpavel
approved these changes
Sep 1, 2026
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.
Removing lib_nn/src/asm/asm_constants.c and lib_nn/src/asm/asm_constants.h as is not used globally, is only used by add elementwise.