-
Notifications
You must be signed in to change notification settings - Fork 297
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
[FIRRTL] Dedup memory wrapper modules in LowerMemory #6719
Conversation
446c753
to
6e562c6
Compare
6e562c6
to
5450f0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the PR comment, I don't understand @mem0
instantiating mem0_ext_0 and mem0_ext. Shouldn't @Dedup
simply be instantiating mem0 twice? The change to the test in the PR looks more like what I'd expect.
Yup, you're right. There's a bug in my change right now, I need to move the Thanks for pointing that out! |
5450f0b
to
8f78137
Compare
Alright, I've made a few updates:
I've updated the PR comment with the new output of |
Side question: in the I'm referring to the fact that all four of these firrtl.circuit "NonLocalAnnotation" {
hw.hierpath private @nla0 [@NonLocalAnnotation::@dut, @DUT::@mem0]
hw.hierpath private @nla0_0 [@NonLocalAnnotation::@dut, @DUT::@mem0, @mem0]
hw.hierpath private @nla1 [@NonLocalAnnotation::@dut, @DUT]
hw.hierpath private @nla1_0 [@NonLocalAnnotation::@dut, @DUT::@sym, @mem0]
... |
8f78137
to
3c0bc7a
Compare
If you change then hierarchy, you need to update the hierpaths. Dedup is somewhat unique in that it has to interpret the NLAs to decide if they matter or not (e.g. block dedup). (this is part of what makes dedup fragile) |
Pinging @youngar and @prithayan as they are more familiar with the memory op related constraints. |
Sorry for the delay, I will take a look at this today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make sense. Dead HierPathOp
can be left for cleanup by later passes, but if symbol names are updated the HierPathOp
needs to be updated and cannot be left in an inconsistent state. The pass is already handling them correctly.
3c0bc7a
to
a7a5e65
Compare
Thanks for clearing that up @prithayan! Is there anything I should take care of before this can be merged? Let me know if you'd like me to rebase on the latest |
Please rebase and merge it. |
a7a5e65
to
27f04d8
Compare
I've rebased, but I don't have write permissions, so someone else will have to merge it. |
27f04d8
to
34cf7c3
Compare
Instead of just dedup-ing the external memory module, we include the memory wrapper module in the dedup calculation. Resolves llvm#6445.
34cf7c3
to
d15a62d
Compare
@prithayan just rebased again, can you merge this please? Thanks! |
Sorry, missed to merge it last week. |
No problem @prithayan, thanks so much for taking care of this! |
This reverts commit 2e23cda. This change caused memories that were previously deduping to no longer dedupe, so we're reverting this while we investigate. An issue will be created to include a small reproducer and track re-landing this change.
Instead of just dedup-ing the external memory module, we include the memory wrapper module in the dedup calculation.
Resolves #6445.
Diff in
circt-opt -firrtl-lower-memory test/Dialect/FIRRTL/lower-memory.mlir
after this change: