Closed Bug 1044212 Opened 11 years ago Closed 8 years ago

IonMonkey: Rewrite alias analysis with EmulateStateOf<MemoryView>

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nbp, Assigned: nbp)

References

Details

Attachments

(5 files)

In our current implementation of Alias Analysis, we keep a vector of alias sets with potential clusters within the alias set where we distinguish between values which might alias on or the other. The goal of this bug is just to do some cosmetic changes before the ground work which would be part of Bug 897606. This bug focus on using EmulateStateOf<MemoryView> (Bug 1040738) for implementing our alias analysis without changing the result that it produces. This implies multiple changes such as adding a new visit function to wrap the accept function of the MDefinition. Moving the EmulateStateOf function to a new file which can be used by the current scalar replacement implementation and alias analysis. And converting the Alias Analysis to use this new model.
This patch add a MDefinitionVisitor::visit function such that we can factor common parts of visitors. This is a useful trick to reduce the amount of changes to Alias Analysis when transitionning to EmulateStateOf.
Attachment #8463377 - Flags: review?(sunfish)
Comment on attachment 8463377 [details] [diff] [review] Part 1 - Wrap the accept function in a MDefinition* visit function. Review of attachment 8463377 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit/MOpcodes.h @@ +239,5 @@ > { > public: > + // Handle task which is common to every instruction, and/or dispatch to > + // specialized visit function. > + inline bool visit(MDefinition *def); This is being defined outside the class because it needs the definition of MDefinition. Would it make sense to just move the whole MDefinitionVisitor class into MIR.h, right after MDefinition? Then it could define visit inside the class.
Attachment #8463377 - Flags: review?(sunfish) → review+
(In reply to Dan Gohman [:sunfish] from comment #3) > Comment on attachment 8463377 [details] [diff] [review] > Part 1 - Wrap the accept function in a MDefinition* visit function. > > Review of attachment 8463377 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: js/src/jit/MOpcodes.h > @@ +239,5 @@ > > { > > public: > > + // Handle task which is common to every instruction, and/or dispatch to > > + // specialized visit function. > > + inline bool visit(MDefinition *def); > > This is being defined outside the class because it needs the definition of > MDefinition. Would it make sense to just move the whole MDefinitionVisitor > class into MIR.h, right after MDefinition? Then it could define visit inside > the class. I think this make sense, especially since we are moving MIR instructions in a separated file.
This patch use EmulateStateOf<...> to express what is currently done by the alias analysis phase. Bug 897606 would make this look more like the scalar replacement implementation.
Attachment #8463475 - Flags: review?(jdemooij)
Comment on attachment 8463471 [details] [diff] [review] part 3 - Initialize OSR block starting state. r= Review of attachment 8463471 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jit/MIRAlgorithms-inl.h @@ +32,5 @@ > + return false; > + > + if (graph_.osrBlock() && !view.initStartingState(&states_[graph_.osrBlock()->id()])) > + return false; > + } I'm not sure what the best place is for this, but could you add a comment somewhere in the interface mentioning this behavior? -- the behavior that startingBlock() returning null means that initStartingState is called on both the regular and OSR entries, and the RPO walk begins at the regular entry.
Attachment #8463471 - Flags: review?(sunfish) → review+
Attachment #8463472 - Flags: review?(sunfish) → review+
Comment on attachment 8463379 [details] [diff] [review] Part 2 - Move EmulateStateOf<...> to MIRAlgorithms.h. (Clearing reviews for now.)
Attachment #8463379 - Flags: review?(jdemooij)
Attachment #8463475 - Flags: review?(jdemooij)
Let's close this bug for the moment, as we changed the Alias Analysis without using the EmulateStateOf way of walking the graph.
Status: ASSIGNED → RESOLVED
Closed: 8 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: