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] Passing memories by reference #7164

Merged
merged 21 commits into from
Nov 4, 2024

Conversation

jiahanxie353
Copy link
Contributor

This patch addresses #4831 .

If the main FuncOp has memrefs in its arguments, we create a new main component and make it the new entry point.

lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Show resolved Hide resolved
lib/Dialect/Calyx/CalyxOps.cpp Show resolved Hide resolved
include/circt/Dialect/Calyx/CalyxControl.td Show resolved Hide resolved
@cgyurgyik
Copy link
Member

Nice! A few small comments and request for tests.

@jiahanxie353 jiahanxie353 marked this pull request as ready for review June 13, 2024 18:08
@jiahanxie353 jiahanxie353 force-pushed the pass-mem-by-ref branch 2 times, most recently from bc067c6 to 5b11808 Compare June 17, 2024 22:46
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.

Nice! A few smaller coding-related comments.

include/circt/Dialect/Calyx/CalyxLoweringUtils.h Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Dialect/Calyx/CalyxOps.cpp Outdated Show resolved Hide resolved
@rachitnigam rachitnigam added the Calyx The Calyx dialect label Jul 29, 2024
…tance with both memref and non-memref arguments
…t alloc into the new top-level marking it external and mark the old top-level alloc-memories non-external/reference; reason being the calyx compiler requires external memories only exist in the top-level
because we will erase all `alloc` ops in the original top-level function,
and build new `alloc` ops in the new top-level function to pass them through `call`.
Also reimplement the logic used for identifying the corresponding reference
memory cell in the callee when building `invokeOp`.
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 smaller comments! Let me know if I'm misunderstanding something.

lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Conversion/SCFToCalyx/SCFToCalyx.cpp Outdated Show resolved Hide resolved
lib/Dialect/Calyx/CalyxOps.cpp Outdated Show resolved Hide resolved
@jiahanxie353 jiahanxie353 merged commit 70a3fc9 into llvm:main Nov 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Calyx The Calyx dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants