[PATCH] D46564: [SSAUpdaterBulk] Sort blocks in IDF to avoid non-determinism.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 18:12:36 PDT 2018


dberlin added a comment.

In https://reviews.llvm.org/D46564#1090834, @mzolotukhin wrote:

> > The solution in IDF should just be changing domtreenodepair to a tuple, with the last item being domtreenode->getDFSNumIn()
>
> Just to make sure I understand you correctly: we need to change `pair<DomTreeNode *, unsigned>` to `tuple<DomTreeNode *, unsigned, unsigned>` and use the second and third elements as keys for the priority queue (i.e. we will need to implement a compare function for it, which will look at RootLevel first and at DfsNumber second if RootLevels are the same). Is it what you meant?
>
> Michael


Correct.
You actually could just use pair<DomTreeNode *, pair<unsigned, unsigned>> and it should work only having to change the two lines pushing onto pq, though it's uglier in the abstract
Just call    DT->updateDFSNumbers() at the beginning of IDF::calculate to ensure DFS numbers are up to date.


Repository:
  rL LLVM

https://reviews.llvm.org/D46564





More information about the llvm-commits mailing list