Skip to content

Avoid creating an additional constant in a region where the constant already exists #733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

haved
Copy link
Collaborator

@haved haved commented Jan 9, 2025

When a theta is given a passthrough constant, it can redirect users of the output to the original constant.

@haved haved requested a review from phate January 9, 2025 12:03
@phate
Copy link
Owner

phate commented Jan 9, 2025

@haved This might be the right time to write some unit tests for this pass?

@haved
Copy link
Collaborator Author

haved commented Jan 9, 2025

@phate Magnus and I looked at what the NodeReduction pass accomplishes, and it seems good at propagating constants, in addition to doing constant folding. Do we need a separate pass in hls that does this, or could we use shared code instead?

@phate
Copy link
Owner

phate commented Jan 9, 2025

@haved I do not know what the distribute constants pass does, but if it really only performs constant folding and propagation, then this is better done using node reductions.

@sjalander
Copy link
Collaborator

The distributed constant pass doesn't have any effect on the results. So I've opened a PR that removes it #734. We should try to add NodeReduction as an optimization.

@sjalander sjalander merged commit 2223b31 into master Feb 1, 2025
12 checks passed
@sjalander sjalander deleted the hls-avoid-extra-constant branch February 1, 2025 11:48
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