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

[Calyx] LICM after Affine ParallelOp unrolling #8256

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jiahanxie353
Copy link
Contributor

This patch does LICM after unrolling affine.parallel operations in order to prevent potential memory access contentions.

Copy link
Member

@cgyurgyik cgyurgyik left a comment

Choose a reason for hiding this comment

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

A few nits and requests.

return
}
}

Copy link
Member

Choose a reason for hiding this comment

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

I think a couple more simple unit tests would instill some confidence. Like, does this handle cases where a dependent write occurs after in the affine.for, e.g.,

affine.parallel 0 to 2 {
  %i = affine.for 0 to 8 {
    %1 = store 42, %a[%i];
    %0 = load %a[0];
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This example breaks my code, thanks for bringing it up

Copy link
Member

Choose a reason for hiding this comment

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

Can we have a test for this?

Copy link
Member

Choose a reason for hiding this comment

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

Spoke offline; I'll leave this to your discretion.

@jiahanxie353
Copy link
Contributor Author

I've updated the implementation based on the reviews, thanks @cgyurgyik !
Also, I've renamed LICM to MemoryBankConflictResolver, which reflects the reality better.

@jiahanxie353 jiahanxie353 self-assigned this Feb 20, 2025
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.

2 participants