[PATCH] D40227: [Hexagon] Use stable sort for HexagonShuffler to remove non-deterministic ordering

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 19 12:03:47 PST 2017


mgrang added a comment.

In HexagonShuffler.h, the lessCore and lessCVI comparators sort insts based on the number of units set. Now, two insts can have the same units set so their relative ordering is not defined.
We could add an index field as a tie-breaker but that would mean changes to function APIs which I felt could be an overkill. Hence, I went with the simpler approach to just use stable_sort instead.
Please let me know your thoughts on this.


Repository:
  rL LLVM

https://reviews.llvm.org/D40227





More information about the llvm-commits mailing list