[llvm] [IVDescriptors] Don't require nsz/nnan for (min|max)num. (PR #137003)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 25 14:01:24 PDT 2025


arsenm wrote:

> For the vector-reduction case, we will need to generate one extra op to silence the NaN, as the reduction value is guaranteed no-snan, if the start value isnt' snan.

We should be able to avoid the canonicalizes in the minimumnum codegen in most cases. In AMDGPU we have a DAG optimization to try to prune out redundant canonicalizes during selection. It's theoretically broken if an incoming FP operation that should canonicalizes ends up dropping the canonicalize later. If we strengthened the CodeGen rules to disallow the canonicalize dropping we permit in the IR, we could do a better job cleaning these out in the combiner.

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


More information about the llvm-commits mailing list