Skip to content
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

[Arc] Fix folding of initialized StateOp #7653

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

fzi-hielscher
Copy link
Contributor

When adding the initial value parameter to the StateOp I forgot to adapt its folder. This PR should fix that.

  • Fold a permanently disabled state to its initial value (if present) instead of zero.
  • Don't fold a state that is permanently reset if it has an explicit initial value.
  • Don't attempt to constant fold a result-less StateOp to avoid an infinite loop.

@fzi-hielscher fzi-hielscher added bug Something isn't working Arc Involving the `arc` dialect labels Oct 2, 2024
Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! And great catch with the 0 result values.

@fzi-hielscher
Copy link
Contributor Author

Sorry, it just occurred to me that this is also incorrect if the initial value is time-variant (you'd think I knew better after the discussion in #7638 😅 ). We need to make sure that a 'dynamic' initial value is materialized in the arc.initial op and not in the actual clock tree.
I'll restrict the folding to constants for now...

@fzi-hielscher fzi-hielscher merged commit 7fff704 into llvm:main Oct 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arc Involving the `arc` dialect bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants