[PATCH] D39410: [GVNHoist] Fix non-deterministic sort order of PHIs for identical instructions
Mandeep Singh Grang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 29 19:56:00 PDT 2017
mgrang created this revision.
This fixes failure in Transforms/GVNHoist/hoist.ll uncovered by https://reviews.llvm.org/D39245.
Repository:
rL LLVM
https://reviews.llvm.org/D39410
Files:
lib/Transforms/Scalar/GVNHoist.cpp
Index: lib/Transforms/Scalar/GVNHoist.cpp
===================================================================
--- lib/Transforms/Scalar/GVNHoist.cpp
+++ lib/Transforms/Scalar/GVNHoist.cpp
@@ -703,7 +703,7 @@
// Vector of PHIs contains PHIs for different instructions.
// Sort the args according to their VNs, such that identical
// instructions are together.
- std::sort(CHIs.begin(), CHIs.end(), cmpVN);
+ std::stable_sort(CHIs.begin(), CHIs.end(), cmpVN);
auto TI = BB->getTerminator();
auto B = CHIs.begin();
// [PreIt, PHIIt) form a range of CHIs which have identical VNs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39410.120764.patch
Type: text/x-patch
Size: 629 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171030/54a0d596/attachment.bin>
More information about the llvm-commits
mailing list