[PATCH] D155811: MachineSink: Fix strict weak ordering in GetAllSortedSuccessors

Danila Kutenin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 03:19:37 PDT 2023


danlark created this revision.
danlark added a reviewer: arsenm.
Herald added a subscriber: hiraditya.
Herald added a project: All.
danlark requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155811

Files:
  llvm/lib/CodeGen/MachineSink.cpp


Index: llvm/lib/CodeGen/MachineSink.cpp
===================================================================
--- llvm/lib/CodeGen/MachineSink.cpp
+++ llvm/lib/CodeGen/MachineSink.cpp
@@ -877,7 +877,7 @@
       AllSuccs, [this](const MachineBasicBlock *L, const MachineBasicBlock *R) {
         uint64_t LHSFreq = MBFI ? MBFI->getBlockFreq(L).getFrequency() : 0;
         uint64_t RHSFreq = MBFI ? MBFI->getBlockFreq(R).getFrequency() : 0;
-        bool HasBlockFreq = LHSFreq != 0 && RHSFreq != 0;
+        bool HasBlockFreq = LHSFreq != 0 || RHSFreq != 0;
         return HasBlockFreq ? LHSFreq < RHSFreq
                             : CI->getCycleDepth(L) < CI->getCycleDepth(R);
       });


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155811.542408.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/2b94efa7/attachment.bin>


More information about the llvm-commits mailing list