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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 20:44:19 PST 2025


michaelmaitland 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 `>=`.

The assertion failure didn’t show up in pre-commit CI and I haven’t gotten any build bot failures. So thanks for pointing it out. Can you please revert or make the change to > for me as I am currently AFK for the night?

Thanks. 

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


More information about the llvm-commits mailing list