Warp: Re-enable the LPowI optimisation
Categories
(Core :: JavaScript Engine: JIT, enhancement, P1)
Tracking
()
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(1 file)
Warp currently doesn't use the LPowI
optimisation, because PowPolicy
effectively never changes the "power" operand to an Int32 type. The LPowI
optimisation still seems to bring an up to 25% improvement in µ-benchmarks (*), so we should just fix the type policy to bring it back.
(*) The improvements depend on the power operand, i.e. we get the best results when the power operand is small. For larger operands, the time is dominated by js::powi
. We're saving time because LPowI
let's us skip the NumberEqualsInt32
call in js::ecmaPow
and we can instead directly call js::powi
.
Assignee | ||
Comment 1•5 years ago
|
||
Warp creates MPow
with either all operands MIRType::Int32
or MIRType::Double
,
depending on the specialisation. This results in never actually taking the
ins->toPow()->power()->type() == MIRType::Int32
and ins->toPow()->powerIsInt32()
branches in PowPolicy::adjustInputs()
. And that leads to never using the LPowI
optimisation when lowering.
To re-enable the LPowI
optimisation, change PowPolicy
to test if the "power"
operand is ToDouble(Int32)
. And if that's the case, replace the ToDouble
operand with its input, so that we end up with an Int32-typed power operand when
we lower the instruction.
MPow::powerIsInt32
is now no longer used, so it can be removed, too.
Updated•5 years ago
|
Comment 3•5 years ago
|
||
bugherder |
Updated•4 years ago
|
Description
•