[llvm] [InstCombine] Don't convert a compare+select into a minnum/maxnum intrinsic that can't be lowered back to a compare+select (PR #177821)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 06:29:56 PST 2026


sjoerdmeijer wrote:


> The shared snippet is missing the initialization code for the arrays. Does it really benchmark a maximum reduction over zero-initialized arrays? If so, the benchmark is completely useless.
> 
> If someone wants to work on improving unrolled FP min/max reductions (that sounds fairly sensible) or on supporting maxnum in SelectOptimize (I'd question the value of this more, but at least the pass already handles various other patterns that get converted to selects, like extension ops), I'd say feel free. But otherwise, a TSVC benchmark is likely not worth spending time on.
> 
> I don't think that this patch itself is doing anything problematic in itself.

Agreed. 

Just a quick note on TSVC: it's a completely useless and artificial benchmark, so optimising it is not a goal in itself,  but it's only used to capture codegen differences. It's nice and convenient to capture this in a small benchmark, but then needs further assessment. I guess the identified opportunity for unrolling FP min/max reductions is a good outcome of this, it looks general, and potentially an useful improvement. 

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


More information about the llvm-commits mailing list