Closed
Bug 1019188
Opened 10 years ago
Closed 10 years ago
Perform an int32 test for mixed int32/boolean tests
Categories
(Core :: JavaScript Engine: JIT, defect)
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
patch
|
sunfish
:
review+
|
Details | Diff | Splinter Review |
This seems to be something that changed in the C++ -> asm.js compilation stack sometime back but at least some tests in awfy asmjs-apps now have phis that mix together int32 and boolean inputs before passing them into conditional tests. The code generated for these by Ion will be pretty bad. The attached patch looks for this and converts the boolean inputs to int32 so that the phi and test will both be typed. This improves my time on zlib-throughput with --no-asmjs from 2395 to 2185 (with asm.js is 1850).
Attachment #8432736 -
Flags: review?(jdemooij)
Comment 1•10 years ago
|
||
Comment on attachment 8432736 [details] [diff] [review]
patch
Review of attachment 8432736 [details] [diff] [review]:
-----------------------------------------------------------------
I'm not very familiar with the RA code. Forwarding to sunfish.
Attachment #8432736 -
Flags: review?(jdemooij) → review?(sunfish)
Comment 2•10 years ago
|
||
Comment on attachment 8432736 [details] [diff] [review]
patch
Review of attachment 8432736 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/jit/RangeAnalysis.cpp
@@ +2443,5 @@
> +
> + if (test->input()->type() != MIRType_Value)
> + return;
> +
> + if (!test->input()->isPhi() || !test->input()->hasOneDefUse() || test->input()->isImplicitlyUsed())
Should this be hasOneUse() instead of hasOneDefUse()? If there are resume point uses, they need the original boxed value, right?
Attachment #8432736 -
Flags: review?(sunfish) → review+
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Dan Gohman [:sunfish] from comment #2)
> Comment on attachment 8432736 [details] [diff] [review]
> patch
>
> Review of attachment 8432736 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: js/src/jit/RangeAnalysis.cpp
> @@ +2443,5 @@
> > +
> > + if (test->input()->type() != MIRType_Value)
> > + return;
> > +
> > + if (!test->input()->isPhi() || !test->input()->hasOneDefUse() || test->input()->isImplicitlyUsed())
>
> Should this be hasOneUse() instead of hasOneDefUse()? If there are resume
> point uses, they need the original boxed value, right?
I think this needs to be hasOneDefUse() for the optimization to work, as the phi is also consumed by a resume point at the start of the block with the test. That resume point shouldn't be associated with any actual fallible instructions (could check for that instead I guess), but even if it was then using the modified phi should be fine --- the phi is only used by the test, which will behave the same whether the term is an int32 or boolean, even if the test ends up executing in baseline instead of ion.
Assignee | ||
Comment 4•10 years ago
|
||
Comment 5•10 years ago
|
||
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•