[llvm] InstCombine: Stop using nsz in multi-use min/max fold (PR #176579)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 23 01:14:53 PST 2026
nikic wrote:
I think the issue in this example is the usual problem with non-det operations: Simplifying them requires materializing the non-determinism. You can't make the non-deterministic choice only for one use, you have to make it for all of them.
So here, the minnum nsz can return either +0 or -0, and you choice the -0 result for the function return value. But you do not chose the stored result, so that one could make a conflicting choice of +0. This is not valid, as the values must be the same, not matter how you chose.
https://github.com/llvm/llvm-project/pull/176579
More information about the llvm-commits
mailing list