Implement fast DFA's escape analysis - #23314
Conversation
|
|
|
|
06e60d1 to
3fdf65a
Compare
|
*(cast(void[]*)&ret) = _d_newarrayUTrace(__FILE__, __LINE__,
__FUNCTION__, typeid(E[]), size);
|
|
scope tint32 = new TypeBasic(ASTCodegen.Tint32);
tint32.merge();
ASTCodegen.Type.tint32 = tint32;
|
|
Aw after fixing bugs I've lost Ocean's null deref report that I was quite proud of. Oh well, at least it was 0 + 0. I don't think I can bring it back there is a rather large comment at this point showing why it can't be. |
|
But only after I fix a segfault in dmd.mangle.cppwin: extern (D) this(VisualCPPMangler rvl) scope @safe
{
this.saved_idents[] = rvl.saved_idents[];
this.saved_types[] = rvl.saved_types[];
this.loc = rvl.loc;
this.eSink = rvl.eSink;
}Missing eSink assignment.
EDIT: it is due to mangling happening by the fast dfa engine's entry point for CI purposes, and it's hitting this untested path for the c++ header generator. |
cb21119 to
7ea9cc9
Compare
|
Oh this gets even more interesting. If I add This is no good at all. EDIT: #23405 |
|
Hit a null deref in higgs: https://forum.dlang.org/post/cokarawrrezphlcftdtx@forum.dlang.org filed bug report. |
31ca74b to
800a9cd
Compare
|
dmd's and druntime's testsuites seem to be passing now.
|
|
Ooo a true positive in sdc: src/format/rulevalues.d(44,4): Error: Expression reads from an uninitialized variable, it must be written to at least once before reading
ret.indirect = indirect.dup;
^
src/format/rulevalues.d(40,14): For variable `ret`
RuleValues ret = void;
^Same problem as std.json, indirect is a method that will initialize. |
|
Another in vibe.d, this time it's a test that won't run. web/vibe/web/internal/rest/jsclient.d(181,30): Error: Argument is expected to be non-null but was null
app.generateInterface!DUMMY(null, null, true);
^
web/vibe/web/internal/rest/jsclient.d(37,24): For parameter `jsgenset` in argument 2
JSRestClientSettings jsgenset, bool parent)
^ |
DMD perf check
|
|
Okay this is about as good as it's going to get. |
| @@ -0,0 +1,217 @@ | |||
| // DO NOT RENAME THIS MODULE, name enables __FastDFAEscapeTest UDA | |||
There was a problem hiding this comment.
why? is the name magic?
There was a problem hiding this comment.
Yes, hence the comment.
There was a problem hiding this comment.
Why? this sounds like a bad idea to have magic for this.
There was a problem hiding this comment.
It verifies that inference worked correctly.
There is no way to do this without an attribute of some kind and right now, I don't think it should be user-facing.
There was a problem hiding this comment.
To be specific, this function should never run outside of the CI: https://github.com/dlang/dmd/pull/23314/changes#diff-21bdd9bfc8b25235bf3818d6be16364822ced9b72ed4ff3c894a9e8b8f175e84R327
| @@ -0,0 +1,85 @@ | |||
| // DO NOT RENAME THIS MODULE, name enables __FastDFAEscapeTest UDA | |||
|
As far as I'm concerned this is complete at this point, there is nothing else to really do in this PR. |
Escape analysis for the fast dfa engine based upon my previous DIP design work.
Two relationship strengths are implemented as well as an unknown state.
In outer cell of parameter
@escape(var&)+ via indirection@escape(var=)No new attributes for users to use are implemented as that requires DIP.
There is a UDA recognized for specifically named test files, this does not affect the rest of the frontend. It is required for verifying inference.
Currently the engine is forced on for all code, except some specific test suite files, both of this will be disabled prior to merging. Have to verify what the CI as a whole does and that requires this behaviour. Same as previous PRs.