redo register assignment for SCfastpar and SCshadowreg parameters#9608
redo register assignment for SCfastpar and SCshadowreg parameters#9608dlang-bot merged 2 commits intodlang:masterfrom
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 fetch digger
dub run digger -- build "master + dmd#9608" |
905b5dd to
673508b
Compare
test/runnable/test_cdcmp.d
Outdated
| // PERMUTE_ARGS: | ||
| // only testing on SYSV-ABI, but backend code is identical across platforms | ||
| // DISABLED: win32 win64 osx linux32 freebsd32 | ||
| // DISABLED: win32 win64 osx linux32 freebsd32 linux64 freebsd64 |
There was a problem hiding this comment.
What is the point of this test if it's now disabled on all platforms dmd supports?
There was a problem hiding this comment.
Because it's a highly annoying test.
- It breaks every time I try to adjust the code generator.
- Compiling the updating version of it is a nuisance.
- Compiling the updating version requires the very latest Phobos to be installed and working.
- Meanwhile, while trying to get (3) to work, the autotester won't test the rest of the compiler.
- The compiler test suite shouldn't rely on Phobos, because that makes bootstrapping the compiler hard. Let alone the very latest Phobos (it requires std.typecons.EnumMembers).
I'll deal with it dead last.
There was a problem hiding this comment.
the very latest Phobos to be installed and working.
No that test is almost two years old, so the update script can't rely on "the very latest Phobos".
The compiler test suite shouldn't rely on Phobos, because that makes bootstrapping the compiler hard
You do realize that the very script that you use to b execute the tests has been written in D? (d_do_tests)
Also, this test only requires Phobos for updating itself - not running.
There was a problem hiding this comment.
DMD 2.060 (from 2012) has a bug fix for EnumMembers:
https://dlang.org/changelog/2.060.html
I don't have time to look more into the past and you probably still need a recent version of DMD/Phobos, because for example everything before 2.072 was compiled without PIC meaning that you can't run it on any modern Linux distribution. Also our bootstrapping version of DMD is 2.079. That's what all CIs use too. We're not going to cater for anything below 2.079.
There was a problem hiding this comment.
The test updater bootstrap requires being compiled WITH THE COMPILER THAT IS UNDER TEST. This does not work, it has nothing to do with d_do_tests which can be compiled with an older build. Any change in the compiler that changes linking, like adding dip1000 changes, makes this NOT WORK.
test_cdcmp.d does not add value and is simply a nuisance.
Worse, it relies on all this working:
import std.algorithm : canFind, find, splitter, until;
import std.array : appender, join;
import std.conv : to;
import std.exception : enforce;
import std.file : readText;
import std.format : formattedWrite;
import std.meta : AliasSeq;
import std.path : baseName, setExtension;
import std.process : environment, execute, pipeProcess, wait;
import std.range : dropOne;
import std.regex : ctRegex, matchFirst, replaceFirstInto;
import std.stdio : File, stdout, writeln;
import std.string : strip;
import std.typecons : tuple, EnumMembers;
There was a problem hiding this comment.
Basically all of Phobos has to work perfectly for this test to even compile, let alone run. It's just completely wrong for a back end test.
There was a problem hiding this comment.
Basically all of Phobos has to work perfectly for this test to even compile, let alone run.
NOPE: it requires no Phobos at all. Note the version(update):
dmd/test/runnable/test_cdcmp.d
Lines 26 to 28 in ecbb547
It's only required for the automated update script.
There was a problem hiding this comment.
The update version has to be run with the compiler under test, and it relies on Phobos.
There was a problem hiding this comment.
Nope, you set the DMD under test via an environment (as the update script header explains) and can thus continue to use the host compiler for compiling the update script.
wilzbach
left a comment
There was a problem hiding this comment.
Let's not disable Martin's code gen tests without a good reason.
|
The "good reason" is because of a circular dependency on the compiler being tested to generate the tests, i.e. Phobos and the test updater have to be compiled with the compiler that is under test. |
|
I'm planning some more alterations to the code generator after this one, which will just mess this up again. So I suggest deferring re-enabling these tests until the next release. |
No, that's absolutely not true. You can use any moderately recent Phobos version (like e.g. the one bundled with the Host DMD that you have to use to compile DMD). |
|
In this case, compiling with |
Or it should be fixed before adding more code that depends on it instead of disabling it. |
|
Or simply disable the test. |
3ebe1cb to
9a13e48
Compare
|
I'm okay with disabling the test. This way of validating compiler output is an ongoing job in and of itself. |
Sorry, this doesn't make any sense to me. The test in question has been added by Martin about two years ago. We have never had any problems with it so far and it's the only way we have to test this. Anyhow, as mentioned if we disable something that's been working well for years without any replacement, a better reasoning than principles is needed. |
1d57b98 to
ca28c34
Compare
|
It comes with a handy auto-update feature. What's your issue with it?
I strongly disagree, see e.g. #7003 or #7849 for the motivation behind these tests.
It's the same as deleting. |
They're poor motivation. Even Martin wrote: "I've disabled the OSX and Windows asm comparison tests completely. They use the same backend code, but due to ABI differences the assembly is different. Seems more pragmatic to just disable those tests instead of inventing some fuzzy matching." |
To clarify: I meant what's wrong with running the update script? It's easy and I just did that for you... If objdump is easier for you, I guess we can also convert these tests. |
@MartinNowak's point was that they use the same backend code which means that his added tests covered all platforms even if enabled only and thus avoided the need for fuzzy matching. |
Sounds reasonable to me ;). |
980cf45 to
2d22ff5
Compare
|
This change usually (but not always) produces better code, as the diffs show. The larger code generated examples are all due to the same effect - live register analysis is blocking using the fastpar register directly. I don't have a good solution to that at the moment, but this PR is still overall an improvement, and I don't want to make it even more complex. |
Martin's code has been replaced with a shell script.
|
@wilzbach @thewilsonator this is ready now. |
andralex
left a comment
There was a problem hiding this comment.
I hope the controversy has been put to sleep now. Thanks!
|
This PR introduced a regression https://issues.dlang.org/show_bug.cgi?id=23084 |
Turns out the way this was done before was too clever, it would prevent allocation of register parameters to the registers they came in. This fix should result in better register allocation on 64 bit targets. It doesn't matter for 32 bit targets as parameters are passed on the stack, not registers.