[all-commits] [llvm/llvm-project] 9d555b: [DFAJumpThreading] make update order deterministic

Olle Fredriksson via All-commits all-commits at lists.llvm.org
Tue Feb 1 08:04:14 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d555b4a83bf72450d417c69aa0be250f0a490e4
      https://github.com/llvm/llvm-project/commit/9d555b4a83bf72450d417c69aa0be250f0a490e4
  Author: Olle Fredriksson <fredriksson.olle at gmail.com>
  Date:   2022-02-01 (Tue, 01 Feb 2022)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

  Log Message:
  -----------
  [DFAJumpThreading] make update order deterministic

We tracked down some non-determinism in compilation output to the
DFAJumpThreading pass. These changes fixed our issue:

* Make the DefMap type a MapVector to make its iteration order depend on
  insertion order.
* Sort the values to be inserted into NewDefs by instruction order to
  make the insertion order deterministic. Since these values come from
  iterating over a ValueMap, which doesn't have deterministic iteration
  order, I couldn't fix this at its source.

Reviewed By: alexey.zhikhar

Differential Revision: https://reviews.llvm.org/D118590




More information about the All-commits mailing list