[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering
authorMandeep Singh Grang <mgrang@codeaurora.org>
Tue, 28 Nov 2017 19:55:54 +0000 (19:55 +0000)
committerMandeep Singh Grang <mgrang@codeaurora.org>
Tue, 28 Nov 2017 19:55:54 +0000 (19:55 +0000)
commit230b0a147784856eefcc39ad7a51259647c5814f
tree18b097e34e0599bf385fcddc6704295e9f7d8c7d
parentd49bd0cd872bf09df17b9a986821f5b057d4896d
[SelectionDAG] Make sorting predicate stronger to remove non-deterministic ordering

Summary:
Recommitting this with the correct sorting predicate. The Low field of Clusters is a ConstantInt and
cannot be directly compared. So we needed to invoke slt (signed less than) to compare correctly.

This fixes failures in the following tests uncovered by D39245:

LLVM :: CodeGen/ARM/ifcvt3.ll
LLVM :: CodeGen/ARM/switch-minsize.ll
LLVM :: CodeGen/X86/switch.ll
LLVM :: CodeGen/X86/switch-bt.ll
LLVM :: CodeGen/X86/switch-density.ll

Reviewers: hans, fhahn

Reviewed By: hans

Subscribers: aemerson, llvm-commits, kristof.beyls

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

llvm-svn: 319210
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp