[llvm] [GlobalMerge][NFC] Skip sorting by profitability when it is not needed (PR #124146)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 20:34:39 PST 2025


jyknight wrote:

This was not NFC: it causes the comparator not have strict-weak-ordering, because `comp(a, b) && comp(b, a)` can now be true. Most immediately, this triggers an assert with the test llvm/test/CodeGen/AArch64/global-merge-group-by-use.ll when run under a hardened stdlib (`assertion !__comp_(__l, __r) failed: Comparator does not induce a strict weak ordering`).

I believe you meant to use `>` instead of `>=`.

https://github.com/llvm/llvm-project/pull/124146


More information about the llvm-commits mailing list