This is an archive of the discontinued LLVM Phabricator instance.

Make OrderedInstructions able to handle queries that Dominators could do, but faster (OrderedInstructions is O(N) once, O(1) after that, Dominators is O(N) all the time)
Needs ReviewPublic

Authored by dberlin on Jul 17 2017, 1:46 PM.

Details

Reviewers
davide
Summary

This adds the necessary support to OrderedInstructions to be able to start replacing the O(N) dominates(instruction, {use, instruction}) queries.

This is going to be a long slog because we'll have to pass it along to
a bunch of stuff to keep it up to date in utilities

I'll likely convert it to an analysis along the way, it's currently a utility.

Convert NaryReassociate to OrderedInstructions
Make PredicateInfo use it as well.
These will be committed as separate patches, they are just examples.

Event Timeline

dberlin created this revision.Jul 17 2017, 1:46 PM

Note: I don't claim i believe the answers to be 100% correct from a theory perspective, they just match what dominators gives :)

(Sorry, this is a work in progress, as you can see from the OldResult stuff that i'm using for verification)