Skip to content

Support lhs constant folding for commutative ops#156

Merged
tancheng merged 4 commits intocoredac:mainfrom
ShangkunLi:support-lhs-folding
Oct 17, 2025
Merged

Support lhs constant folding for commutative ops#156
tancheng merged 4 commits intocoredac:mainfrom
ShangkunLi:support-lhs-folding

Conversation

@ShangkunLi
Copy link
Copy Markdown
Collaborator

We support lhs constant folding for commutative ops like add, mul, etc.

@ShangkunLi ShangkunLi marked this pull request as ready for review October 15, 2025 16:27
@ShangkunLi ShangkunLi self-assigned this Oct 15, 2025
@tancheng
Copy link
Copy Markdown
Contributor

Can we have a simple test for this?

@YanzhouTang
Copy link
Copy Markdown
Collaborator

Do we need to support directly get the result when lhs and rhs are both constant?

@tancheng
Copy link
Copy Markdown
Contributor

Do we need to support directly get the result when lhs and rhs are both constant?

I believe there is existing pass can do such thing, e.g., canonicalize pass in arith dialect. Do you see such case exists in our test?

@ShangkunLi
Copy link
Copy Markdown
Collaborator Author

Can we have a simple test for this?

Sure, added in the latest commit.

@tancheng tancheng merged commit 61ea9fe into coredac:main Oct 17, 2025
1 check passed
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