[PATCH] D124725: [NFC][LoopCacheAnalysis] Use stable_sort() to avoid non-deterministic print output

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 1 02:33:17 PDT 2022


fhahn accepted this revision.
fhahn added a comment.

LGTM, thanks!



================
Comment at: llvm/include/llvm/Analysis/LoopCacheAnalysis.h:246
   void sortLoopCosts() {
-    sort(LoopCosts, [](const LoopCacheCostTy &A, const LoopCacheCostTy &B) {
+    llvm::stable_sort(LoopCosts, [](const LoopCacheCostTy &A, const LoopCacheCostTy &B) {
       return A.second > B.second;
----------------
nit: there should be no need to use `llvm::` as this is already in the llvm namespace.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124725/new/

https://reviews.llvm.org/D124725



More information about the llvm-commits mailing list