[llvm] [GVNSink] Fix non-determinisms by using Depth-First ordering (PR #90995)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Wed May 8 18:38:15 PDT 2024
================
@@ -575,6 +607,13 @@ class GVNSink {
unsigned NumSunk = 0;
ReversePostOrderTraversal<Function*> RPOT(&F);
VN.setReachableBBs(BasicBlocksSet(RPOT.begin(), RPOT.end()));
+ // Populated DFSNumbers ahead of time to avoid updating dominator tree
+ // when CFG is modified. The DFSNumbers of newly created basic blocks
+ // are irrelevant because RPOT is also obtained ahead of time and only
+ // DFSNumbers of original CFG are relevant for sinkable candidates.
+ for (auto *BB : RPOT)
----------------
efriedma-quic wrote:
At this point, do you actually need DFS numbering? If any arbitrary numbering works, might as well just number in IR order.
https://github.com/llvm/llvm-project/pull/90995
More information about the llvm-commits
mailing list