[VecCombine] Fix sort comparator logic in foldShuffleFromReductions
authorDavid Green <david.green@arm.com>
Fri, 29 Apr 2022 08:30:02 +0000 (09:30 +0100)
committerDavid Green <david.green@arm.com>
Fri, 29 Apr 2022 08:30:02 +0000 (09:30 +0100)
commit7047c47918a6f84a2d5a1e63882f5af4cafb43a4
treefd7b11a64a6dcd2575374f02dfee7546685fe016
parent884e9a877b378f5bf03f3c85a25b7a139ef6c8d8
[VecCombine] Fix sort comparator logic in foldShuffleFromReductions

I think this sort comparator was overly complex, and the windows
expensive check bot agreed, failing as it was not giving a strict weak
ordering. Change it to use the comparison of the mask values as unsigned
integers. This should sort the undef elements to the end whilst keeping
X<Y otherwise.
llvm/lib/Transforms/Vectorize/VectorCombine.cpp