Closed
Bug 1246141
Opened 10 years ago
Closed 3 years ago
Detect And/Or structure during IonBuilder
Categories
(Core :: JavaScript Engine: JIT, defect, P5)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: h4writer, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
28.68 KB,
patch
|
jandem
:
feedback+
|
Details | Diff | Splinter Review |
We have a dedicated pass that will restructure and/or structure into a better suitable and normal flow. Though that shouldn't be needed.
It is possible to do this during IonBuilder with no overhead. As a result a lot of complicated code can get removed. Since it is even easier to do it in IonBuilder.
Reporter | ||
Comment 1•10 years ago
|
||
4 files changed, 83 insertions(+), 459 deletions(-)
Works in most cases. Though need to check for some fallout in jit-tests
Assignee: nobody → hv1989
Comment 2•10 years ago
|
||
Removing redundant Phi will break the block removal made in branch pruning, see the big huge comment at the top of the IonAnalysis file.
Comment 3•10 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #2)
> Removing redundant Phi will break the block removal made in branch pruning,
> see the big huge comment at the top of the IonAnalysis file.
Oops, reading too fast, this is removing the IsRedundantPhi with filter type.
Also, note that moving it sooner in the pipeline removes opportunities from GVN.
Reporter | ||
Comment 4•10 years ago
|
||
(In reply to Nicolas B. Pierron [:nbp] from comment #3)
> (In reply to Nicolas B. Pierron [:nbp] from comment #2)
> > Removing redundant Phi will break the block removal made in branch pruning,
> > see the big huge comment at the top of the IonAnalysis file.
>
> Oops, reading too fast, this is removing the IsRedundantPhi with filter type.
>
> Also, note that moving it sooner in the pipeline removes opportunities from
> GVN.
nbp, not sure what you are hinting at. This already happens during "Fold tests" currently and will now happen dynamically during IonBuilder. "Fold tests" is the first pass. As a result this will make no difference to GVN
Reporter | ||
Comment 5•10 years ago
|
||
This does the same as "Fold Tests". It detects and/or structures and patches the blocks to the right true/false block directly, instead of doing another test.
This approach is a little bit more advanced, since it also supports chains of and/or opcodes. ("Fold tests doesn't")
This all works and should be land ready. At first I was rather enthusiastic about this approach and it does what it should, without impacting timing on mainthread too much. Though I keep having more and more the feeling this is hiding/fixing the real issue at hand.
We made a nice system with passes that works off thread, except for the first step. This first step creates the CFG and with it also propagates types/resultTypeSet. Because we can only propagate the types during the first step, we are stuck to it and cannot improve it lateron. As a result "improveTypesAtCompare" and "foldAndOr" need to happen in the first step too, to be most effective. The more I'm working on it, the more that seems wrong! Both should be a offthread pass that has the same effectiveness. In order for that to work, we need Off Mainthread Mir Creation. Which failed the last time.
Therefore my request to feedback:
Do we want to land this? Given that this isn't the best approach? Knowing that the best approach is hard and something that might never work out? Or should we land this as an intermediate step, hoping OMMC will someday work?
Attachment #8716275 -
Attachment is obsolete: true
Attachment #8720712 -
Flags: feedback?(jdemooij)
Comment 6•10 years ago
|
||
Comment on attachment 8720712 [details] [diff] [review]
bug1246141-fold-andor
Review of attachment 8720712 [details] [diff] [review]:
-----------------------------------------------------------------
I just skimmed the patch, but I think this makes sense, considering it does the same as the current approach but removes > 360 lines of code.
One concern is that this runs on the main thread instead of the background thread, but the performance of this is negligible I think.
Don't we need this for Odin though?
::: js/src/jit/IonAnalysis.cpp
@@ -787,5 @@
> - return true;
> -}
> -
> -bool
> -jit::FoldTests(MIRGraph& graph)
Nit: also remove FoldTests from the header file.
::: js/src/jit/IonBuilder.cpp
@@ +4257,5 @@
> + MInstructionIterator end = block->end();
> + for (MInstructionIterator it = block->begin(); it != end; it++) {
> + MInstruction* ins = *it;
> + if (ins->isPhi())
> + continue;
Nit: MPhi is a definition but not an instruction, so I don't think it can show up here.
@@ +4458,5 @@
> + if (!input->isPhi())
> + return true;
> +
> + if (input->block() != current) {
> + if (input->block()->numSuccessors() != 0)
I think this should be 1 instead of 0
Attachment #8720712 -
Flags: feedback?(jdemooij) → feedback+
Reporter | ||
Comment 7•10 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #6)
> Don't we need this for Odin though?
Good point...
Updated•9 years ago
|
Priority: -- → P5
Comment 8•3 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: hv1989 → nobody
Comment 9•3 years ago
|
||
A lot has changed and we'd need this for both the Wasm-Ion frontend and WarpBuilder. I think we can close this.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•