Closed Bug 869313 Opened 11 years ago Closed 11 years ago

PJS: Refactor par MIRs and LIRs

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: shu, Assigned: shu)

References

Details

Attachments

(1 file, 3 obsolete files)

We have a bunch of {M,L}Par* that really only differ from their sequential versions in that they take a ForkJoinSlice *. A refactor would be nice.
Attached patch WIP (obsolete) — Splinter Review
A first draft at refactoring. Niko, do you think this approach is even cleaner? Converted MParLambda as an example.
Attachment #746236 - Flags: feedback?(nmatsakis)
Comment on attachment 746236 [details] [diff] [review]
WIP

Review of attachment 746236 [details] [diff] [review]:
-----------------------------------------------------------------

This looks really good.
Attachment #746236 - Flags: feedback?(nmatsakis) → feedback+
Attached patch patch (obsolete) — Splinter Review
Refactor of several Par MIR/LIR to use a variety of MAryInstruction that's optionaly +1 arity for when it's parallelized.

Dave, if you don't want to review this and think it's fine for nmatsakis to review it, feel free to flip the review to him.
Assignee: general → shu
Attachment #746236 - Attachment is obsolete: true
Attachment #747219 - Flags: review?(dvander)
Attached patch v2 (obsolete) — Splinter Review
Both sstangl and nbp expressed concern about the dynamic numOperands() in the previous version. This version keeps arity fixed for both MIR and LIR, and fill the unused ForkJoinSlice during seq. execution with an MConstant::New(UndefinedValue()), which gets lowered into a constant value LAllocation, so should exert no regalloc pressure.
Attachment #747219 - Attachment is obsolete: true
Attachment #747219 - Flags: review?(dvander)
Attachment #747285 - Flags: review?(dvander)
Attached patch v3Splinter Review
Change LParallelizableAllocInstructionHelper to have Min(2, Temps) number of temps instead of always Temps + 2, as the 2 temps needed for parallel alloc should always be able to be reused after allocation is done.
Attachment #747285 - Attachment is obsolete: true
Attachment #747285 - Flags: review?(dvander)
Attachment #747806 - Flags: review?(dvander)
Blocks: 867471
Comment on attachment 747806 [details] [diff] [review]
v3

Talked with dvander about this on IRC; he feels separate IR is cleaner but said to defer to your opinion, so flipping r? to you.

I still feel this refactor makes things a bit cleaner in not duplicating MIR/LIR, especially for IR with more complicated codegen than what's refactored here (allocation).

Like I said during the talk at the work week, I'd like the plan going forward to not have duplicate IR for parallel/sequential modes. If you disagree, please advise.
Attachment #747806 - Flags: review?(dvander) → review?(jdemooij)
Some followup: there are already other IR that operate in both modes.
Comment on attachment 747806 [details] [diff] [review]
v3

Review of attachment 747806 [details] [diff] [review]:
-----------------------------------------------------------------

It's a tough call but I think I agree with dvander. Looking at NewObject, codegen for sequential/parallel is different anyway and MParallelizableAryInstruction, lowerParallelizable etc add (more) complexity for people not too familiar with Ion or parallel execution.

With extra MIR instructions there's some duplication and extra boilerplate, but it's code most of us can ignore most of the time (like the AsmJS* instructions) and it feels less complicated.
Attachment #747806 - Flags: review?(jdemooij)
Closing since refactoring isn't wanted.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: