-
Notifications
You must be signed in to change notification settings - Fork 299
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
[HandshakeToDC] Add pack/unpack lowering patterns #6941
Conversation
This is entirely for lowering |
@teqdruid what struct type? |
hw.struct is the struct type in CIRCT and both Handshake and DC are in CIRCT. It's the practical choice. And it's not tied to hardware in any particular semantic -- just the name. We wouldn't have it there if there was a struct type upstream we could use! I think keeping the argument names around is more important than dialect name purity. And I know you share my aversion to duplicating stuff in each dialect. Plus, there's an argument to be made that there's nothing in the hw or comb dialects that are specifically tied to hardware. |
... except for - for the former - the dialect name itself 🙂. You have a good point, hw.struct is - if we ignore the dialect prefix - an overall more well suited type for this than |
Side note: There was some discussion at EuroLLVM about introducing a general dialect to model struct types in MLIR. There are multiple places where this would be helpful, i.e., Flang, LLVM dialect, CIR, and CIRCT. |
@teqdruid updated the PR s.t. this is now strictly a |
b5d5325
to
bebaf6f
Compare
1125284
to
99f5769
Compare
Adds data-only pack/unpack operations which operates on MLIR tuple-typed values. Don't want these in DC, but there really isn't any other place to put them; and they are required for an end-to-end handshake lowering path. Add tuple packing dc-to-hw lowering remove DC stuff, add tuple -> Hw conversion in Handshake to DC
99f5769
to
81ee72e
Compare
Adds lowering patterns for
handshake.pack/unpack
to DC. For the actual (data-side) tuple operations,hw.struct
s are used. This is purely for pragmatic reasons; Firstly,hw.struct
is for all intents and purposes a generic struct type. Secondly, we don't want data-only operations to leak intoDC
.