-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add name prefixes when functions are inlined #952
Comments
Accidentally closed this issue instead of the related one. Whoops. |
@christiaanb Where is the inlining being performed in |
clash-compiler/clash-lib/src/Clash/Core/Evaluator.hs Lines 357 to 360 in db19778
That |
So interestingly enough, the changes are in and the example in the issue now works as expected. However, the changes to the inlining functions in the
|
|
That's good, gives me a place to start looking. With @leonschoorl and @martijnbastiaan pointed me towards #476 which seems closely related |
Another failing test I didn't spot before:
I would suspect it's generating names with |
That's related to the |
Implemented in: #958 |
We need to add name prefixes when functions are inlined. I.e. when we have
The instance of ‘h’ inside the ‘f’ module is currently called ‘foo’, note that there will be no ‘g’ module as it’s inlined because it doesn’t have a synthesize or noinline pragma. What we still need to do is that when ‘g’ is inlined, all the instance labels are prefixed with “g_”, so that the instance of ‘h’ in ‘f’ is called “g_foo”.
implementation suggestion
Tick
the inlined expression with aNameMod PrefixName (LitTy (SymTy <name_of_inlined_function>))
, make sure to remove all module name qualifiers from the name though.clash-compiler/clash-lib/src/Clash/Normalize.hs
Lines 318 to 340 in db19778
clash-compiler/clash-lib/src/Clash/Normalize.hs
Lines 347 to 354 in db19778
clash-compiler/clash-lib/src/Clash/Normalize/Transformations.hs
Line 368 in db19778
clash-compiler/clash-lib/src/Clash/Normalize/Transformations.hs
Line 949 in db19778
clash-compiler/clash-lib/src/Clash/Normalize/Transformations.hs
Line 1011 in db19778
clash-compiler/clash-lib/src/Clash/Core/Evaluator.hs
Lines 357 to 360 in db19778
The text was updated successfully, but these errors were encountered: