Closed
Bug 1137573
Opened 9 years ago
Closed 9 years ago
OdinMonkey: expose alignment masks to GVN
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: sunfish, Assigned: sunfish)
References
Details
Attachments
(2 files)
21.29 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
2.18 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
This patch rewrites (a+i)&m to (a&m)+i when it's likely that a&m will become redundant, and possibly also that i can be folded as a constant offset. It does so before GVN to expose the redundancy to optimization.
Attachment #8570285 -
Flags: feedback?(luke)
Assignee | ||
Updated•9 years ago
|
Attachment #8570285 -
Flags: feedback?(luke) → review?(luke)
Comment 1•9 years ago
|
||
Comment on attachment 8570285 [details] [diff] [review] alignment-mask-analysis.patch Review of attachment 8570285 [details] [diff] [review]: ----------------------------------------------------------------- Beautiful! ::: js/src/jit/AlignmentMaskAnalysis.cpp @@ +46,2 @@ > } > + if (!lhs->isAdd() || !lhs->hasOneUse() || !rhs->isConstantValue()) From irc, I eagerly await the patch that removes hasOneUse. ::: js/src/jit/IonOptimizationLevels.cpp @@ +23,5 @@ > { > level_ = Optimization_Normal; > > eaa_ = true; > + ama_ = true; EAA can help normal Ion b/c it folds normal arith into MEffectiveAddress, so it deserves to be enabled in initNormalOptimizationInfo, but AMA isn't, so I think it should go into initAsmjsOptimizationInfo.
Attachment #8570285 -
Flags: review?(luke) → review+
Comment 2•9 years ago
|
||
Comment on attachment 8570285 [details] [diff] [review] alignment-mask-analysis.patch Review of attachment 8570285 [details] [diff] [review]: ----------------------------------------------------------------- Nice! ::: js/src/jit/AlignmentMaskAnalysis.cpp @@ +46,2 @@ > } > + if (!lhs->isAdd() || !lhs->hasOneUse() || !rhs->isConstantValue()) I guess this restriction is due to the fact we're replacing one operand of the add below? Could we instead clone the add (GVN happens later)? Does it actually happen in practice a lot that lhs has more than one use at this point? (IonBuilder tends to duplicate MIR nodes most of the time, and GVN happens later, so i wonder if this really is a problem)
Comment 3•9 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #2) > Comment on attachment 8570285 [details] [diff] [review] > alignment-mask-analysis.patch > > Review of attachment 8570285 [details] [diff] [review]: > ----------------------------------------------------------------- > > Nice! > > ::: js/src/jit/AlignmentMaskAnalysis.cpp > @@ +46,2 @@ > > } > > + if (!lhs->isAdd() || !lhs->hasOneUse() || !rhs->isConstantValue()) > > I guess this restriction is due to the fact we're replacing one operand of > the add below? Could we instead clone the add (GVN happens later)? Does it > actually happen in practice a lot that lhs has more than one use at this > point? (IonBuilder tends to duplicate MIR nodes most of the time, and GVN > happens later, so i wonder if this really is a problem) Yes, it's very common to see these (i+c) computations hoisted in Emscripten output and thus to have multiple uses. Could it be handled by creating a new op rather than destructively modifying the op when it has more uses?
Assignee | ||
Comment 4•9 years ago
|
||
Here's the patch which removes the hasOneUse() restriction on the MAdd.
Attachment #8570532 -
Flags: review?(luke)
Comment 5•9 years ago
|
||
Comment on attachment 8570532 [details] [diff] [review] multiple-uses.patch Review of attachment 8570532 [details] [diff] [review]: ----------------------------------------------------------------- Simpler, more general, and at the cost of only a bit more node allocation. Nice!
Attachment #8570532 -
Flags: review?(luke) → review+
Assignee | ||
Comment 6•9 years ago
|
||
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/5def1d193a0c remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/4c9ebb3591c4
https://hg.mozilla.org/mozilla-central/rev/5def1d193a0c https://hg.mozilla.org/mozilla-central/rev/4c9ebb3591c4
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•