-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
replace frontend inliner with backend inliner #14194
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14194" |
|
Unfortunately, the test suite tries to compile the runtime library first. This is backwards. It should compile the compiler test suite first. Only when that passes should it attempt to compile the runtime library, as the test suite is designed to make it easy to track down problems. |
The tests in the testsuite should not be importing the library then. Can't you run the testsuite locally? |
|
If we could actually remove the frontend one entirely that would be a very nice red diff. |
|
checkwhitespace fails, but gives no clue about which file is errant. |
7342849
to
2bc741e
Compare
|
This would require splitting the test suite up into basically simple tests
and D tests. The language cannot be implemented without druntime and hence
cannot be properly tested without it being compiled unless the feature
being tested is a pay as you go one like the work with the template hooks.
This split can be done though. It'd need a simplified object.d which I
think we do have somewhere.
…On Thu, 9 Jun 2022, 06:52 Walter Bright, ***@***.***> wrote:
It would be REALLY REALLY nice if the testers would run the tests in
dmd/test/runnable and dmd/test/compilable FIRST, because those are
designed to debug the compiler. Getting a seg fault in other places is much
HARDER to debug.
—
Reply to this email directly, view it on GitHub
<#14194 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLI75EELUOLP7DQQWZKGV3VOGBAZANCNFSM5YFPN76Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
15d6f7c
to
5a52488
Compare
|
The problems have been reduced to:
|
I'll see if I can spin up one of my macboxes to run the testsuite there later. |
|
This may not be possible, but it would be nice if this would work with inline assembly. It would mean that we wouldn't have to replace the assembly in |
Why does it matter as long as the memory ordering is correct? The backend also isn't a proper load-store ISA so the intrinsics might look a bit weird internally, although with x86 you basically only need to emit the right prefix in a few cases so that plus volatile might be enough. |
Segfaults. You get segfaults. Lock-free concurrent data structures are one of the few areas left of CS where instruction counting still persists. A function call will cause segfaults due to memory unmapping by the time the next step in the algorithm takes place. |
I'm going to need to see an example that segfaults with dmd today because that sounds backwards. |
Lock-free concurrent data structures have no way to synchronize free'ing of memory. They rely solely on timeing to get things right. Andrei has written an introductory paper on this topic. But he only barely touches upon the memory deallocation side of things (which are still to this day not solved). We are getting pretty off-topic now. |
ef495db
to
19b163c
Compare
|
Alls looking nice and green. There are still some fix-ups left to do in the implementation to make it nice and neat. Are we going to switch to this proper now? Or hide it behind a preview flag? Moving forward with this should give us a ~3000 line removal. |
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.
Be sure to change this line too
Lines 1757 to 1758 in 13f9d97
| arg = p.defaultArg; | |
| arg = inlineCopy(arg, sc); |
That should instead be:
arg = p.defaultArg.copy();
After that, then there'll really be no calls into the frontend inliner.
f9874b6
to
b2b52c8
Compare
|
I turned the original inliner back on so both are operating. This is because the backend one doesn't handle all the cases yet the front end one does. This PR is ready to go. The one failing test is a heisenbug. |
The front end inliner has some unfixable problems, and it is way overly complex. I made a mistake with this design, and am tired of it. This replaces it with one in the backend that inlines based on the optimized intermediate code. This is vastly simpler, and will inline much more.
It is currently in a draft state, and disables the frontend one, although the code for it remains for now.
Current shortcomings:
Comments are welcome, just remember it's only a draft at the moment! I expect the usual problems with it.