[WebAssembly] Fix a non-determinism problem in FixIrreducibleControlFlow
authorHeejin Ahn <aheejin@gmail.com>
Sat, 22 Feb 2020 01:01:52 +0000 (17:01 -0800)
committerHeejin Ahn <aheejin@gmail.com>
Sat, 22 Feb 2020 01:05:46 +0000 (17:05 -0800)
commit3648370a79235ddc7a26c2db5b968725c320f6aa
tree057ea1a1997953349559331b4c57ffb819e82629
parentd17123b2577e610b2a19de1f530cecea353c8c7a
[WebAssembly] Fix a non-determinism problem in FixIrreducibleControlFlow

Summary:
We already sorted the blocks when fixing up a set of mutual
loop entries, however, there can be multiple sets of such
mutual loop entries, and the order we encounter them
should not be random, so sort them too.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44982

Patch by Alon Zakai (kripken)

Reviewers: aheejin, sbc100, dschuff

Subscribers: mgrang, sunfish, hiraditya, jgravelle-google, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74999
llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp