[MergeICmps] Make sorting strongly stable on the rhs.
authorClement Courbet <courbet@google.com>
Tue, 21 May 2019 17:58:42 +0000 (17:58 +0000)
committerClement Courbet <courbet@google.com>
Tue, 21 May 2019 17:58:42 +0000 (17:58 +0000)
commit122c6e6f36893907e27234b3e20c58b22483f5a0
treea5a5a93fd8a769bdcadcd7599ba0eed50d82b139
parentbd467cfe4bcdfbe105ecf7b7d4a3da3fcfa92703
[MergeICmps] Make sorting strongly stable on the rhs.

Summary:
Because the sort order was not strongly stable on the RHS, whether the
chain could merge would depend on the order of the blocks in the Phi.

EXPENSIVE_CHECKS would shuffle the blocks before sorting, resulting in
non-deterministic merging.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits, RKSimon

Tags: #llvm

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

llvm-svn: 361281
llvm/lib/Transforms/Scalar/MergeICmps.cpp