Closed Bug 1687975 Opened 5 years ago Closed 5 years ago

Warp: Re-enable the LPowI optimisation

Categories

(Core :: JavaScript Engine: JIT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox86 --- wontfix
firefox87 --- fixed

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.

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.

Severity: -- → N/A
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1901664
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: