Closed Bug 1633736 Opened 4 years ago Closed 4 years ago

Warp: specialize OSR phis

Categories

(Core :: JavaScript Engine: JIT, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

After bug 1632757 we generate good code for an empty for-loop in a function in the non-OSR case, but OSR ends up with unboxing/boxing instructions in the loop body because the OSR entry block has (untyped) Values flowing in, polluting phi types.

To fix this we need to improve phi type analysis to add guards/unboxing to the OSR entry block if needed when WarpBuilder is enabled.

The MagicIsConstructing case can happen with WarpBuilder with later patches.

A later patch will add a second caller.

Depends on D72880

A later patch will use this for null/undefined/magic Values: types that can't
be MUnbox'd.

Depends on D72881

For WarpBuilder we need an alternative to the IonBuilder TI-based mechanism.
It's somewhat similar in spirit: determine types for each slot and then add
guard/unbox instructions to the OSR entry block to check this. See the big
SMDOC comment for details.

This does great on various loops I've been analyzing. We'll have to see how
it works out for the more complicated (nested) loops, but because this is
WarpBuilder-specific code we can hopefully easily change things later if needed.

Depends on D72882

Priority: -- → P2
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21d7efbe77c8
part 1 - Use IsNullOrUndefined and IsMagicType helpers, handle MagicIsConstructing type in replaceRedundantPhi. r=iain
https://hg.mozilla.org/integration/autoland/rev/9358bf6499db
part 2 - Add a helper method for draining phi worklist. r=iain
https://hg.mozilla.org/integration/autoland/rev/b638015cdfd1
part 3 - Add MGuardValue for guarding on a specific Value. r=iain
https://hg.mozilla.org/integration/autoland/rev/78291462524e
part 4 - Specialize OSR phis as part of phi specialization when Warp is enabled. r=iain
Regressions: 1646041
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: