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

[MemoryBanking] Support multi-dimension memory banking #8033

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

Conversation

jiahanxie353
Copy link
Contributor

This patch supports multi-dimensional memory banking in the memory banking pass.

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.

LGTM with one small comment

memoryToBanks[memrefVal] = createBanks(memrefVal, bankingFactor);
for (auto memrefVal : memrefsInPar) {
if (!memoryToBanks.contains(memrefVal))
memoryToBanks[memrefVal] =
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 'try_emplace' is a better fit here, if this container supports it. This avoids the double lookup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, I tried it out but the problem with it is that arguments will be evaluated so do something like try_emplace(memrefVal, createBanks(...)) will invoke createBanks function, which changes the block arguments in-place:

block->insertArgument(blockArgNum + 1 + i, newMemRefType,

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