[PATCH] D45858: [DivRemPairs] Fix non-determinism in use list order.

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 08:58:32 PDT 2018


gberry added a comment.

In https://reviews.llvm.org/D45858#1077153, @mgrang wrote:

> A quick background on the reverse-iteration bot: https://llvm.org/docs/CodingStandards.html#beware-of-non-determinism-due-to-ordering-of-pointers
>  Unordered containers like SmallPtrSet and DenseMap do not guarantee the order of iteration of elements. So iterating them can result in non-deterministic codegen. However, not all instances of iterating an unordered container result in non-determinism. Given this, it becomes difficult to identify which iteration instances can cause this behavior. The reverse iteration bot iterates such containers in reverse, by default, to weed out such cases.
>
> However, the bot is only useful only if there are tests which stress/depend on iteration order. And while it may be possible to write such tests I am not sure if it's worth the effort. My experience also has been that I have randomly run into non-deterministic behavior and debugging led me to problems in iteration order.


@mgrang Out of curiosity, what tests does this bot run?  I assume it is just runs the lit tests as is?  It might be interesting to expand it to also keep a second build without reverse iteration and compare the outputs of the two to make sure they are identical.


Repository:
  rL LLVM

https://reviews.llvm.org/D45858





More information about the llvm-commits mailing list