Skip to content

Conversation

@ShangkunLi
Copy link
Collaborator

In this pr:

  • Provide a template to fuse the RHS constant into its operation
  • Separate the optimization pass as HWAgnostic optimization (e.g., fold-constant) and HWSpecific optimization (e.g., fuse-loop-control)
  • I have removed some predicate attributes in the NeuraOps.td because we need to enable the $rhs as an optional operand. And multiple optional operands are not allowed in mlir.

After applying the fold-constant, the number of ops can be greatly reduced.

For dataflow branch_for.mlir, 40 lines -> 25 lines.
For dataflow simple_loop.mlir, 53 lines -> 29 lines.

@ShangkunLi ShangkunLi marked this pull request as ready for review September 16, 2025 07:29
@ShangkunLi ShangkunLi requested a review from tancheng September 16, 2025 07:29
@tancheng tancheng added the new feature New feature or request label Sep 16, 2025
@tancheng tancheng linked an issue Sep 16, 2025 that may be closed by this pull request
@tancheng tancheng merged commit 0812dc5 into coredac:main Sep 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] Fuse constant into dependent ops

2 participants