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

[LoopScheduleToCalyx] deduplicate groups within a ParOp. #8055

Merged
merged 13 commits into from
Jan 9, 2025
Merged

Conversation

cgyurgyik
Copy link
Member

@cgyurgyik cgyurgyik commented Jan 9, 2025

Deduplicates multiple occurrences of the same Enable in a ParOp. This can be introduced automatically by a compiler lowering phase, so we add this as a canonicalization pattern. Additionally, ensures that the pipeline register (and not the pipeline stage) is used in Calyx computation assignments.

Fixes #8050.

@cgyurgyik cgyurgyik requested a review from jiahanxie353 January 9, 2025 21:36
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

I think this makes sense as a canonicalization, but is the error avoided with the change in LoopScheduleToCalyx? In general, I think we strive for a world where the canonicalizations are not required for success / correctness.

@cgyurgyik
Copy link
Member Author

cgyurgyik commented Jan 9, 2025

I think this makes sense as a canonicalization, but is the error avoided with the change in LoopScheduleToCalyx? In general, I think we strive for a world where the canonicalizations are not required for success / correctness.

It is not, that change avoids a use after free issue. I have not totally fixed the error yet though so going back to draft mode.

(Edit: I agree with your sentiment. I'll follow up later)

@cgyurgyik cgyurgyik marked this pull request as draft January 9, 2025 22:08
@cgyurgyik
Copy link
Member Author

@mikeurbach I've updated this so that canonicalization isn't used as an "operation fixer-upper".

@cgyurgyik cgyurgyik marked this pull request as ready for review January 9, 2025 23:23
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

awesome, thanks for that. looks good to me.

@cgyurgyik
Copy link
Member Author

Thanks! This is branched off #8048 so if you have a chance to review that, it'd be great :-)

Base automatically changed from reg2reg to main January 9, 2025 23:44
@cgyurgyik cgyurgyik changed the title [Calyx] deduplicate groups within a ParOp. [LoopScheduleToCalyx] deduplicate groups within a ParOp. Jan 9, 2025
@cgyurgyik cgyurgyik merged commit 4a062a2 into main Jan 9, 2025
4 checks passed
@cgyurgyik cgyurgyik deleted the calyx-dedup branch January 9, 2025 23: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.

[LoopScheduleToCalyx] Fail due to op still in use
2 participants