Skip to content

Remove unused constant definitions and related includes from asm_constants - #238

Merged
xalbertoisorna merged 2 commits into
developfrom
fix/unused-constants
Sep 1, 2026
Merged

xalbertoisorna merged 2 commits into
developfrom
fix/unused-constants

Conversation

@xalbertoisorna

@xalbertoisorna xalbertoisorna commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.h and lib_nn/src/asm/asm_constants.c and their remaining includes.
  • Inlined VPU constant vectors into add_elementwise.S (assembly) and add_elementwise_ref() (C reference implementation).
  • Tightened internal linkage in add_elementwise.c by making mkmsk() 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.

Comment thread lib_nn/src/c/add_elementwise.c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@xalbertoisorna
xalbertoisorna merged commit ba22742 into develop Sep 1, 2026
4 checks passed
@xalbertoisorna
xalbertoisorna deleted the fix/unused-constants branch September 1, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants