Not clear to me whether these are regressions or not. Depends on how much we prefer to have min/max over other select structures.
We explicitly fold min/max to work on the narrower type, so I'm counting these as improvements.
Regression (missing nsw flag)
This looks neutral.
No longer vectorized?
Thanks for sharing this! I added a couple of 'not' op enhancements to instcombine, so we should be slightly closer now.
This requires rework in SLP. It assumes that min/max patterns are only in cmp+sel form. I made it work for FP (maxnum/minnum) already, so I'll take a look.
Thanks! I've updated with new results. It looks like we still need a few more folds for not to reach parity.
Still regresses -- in this case we'd want to push the not into NOT_VALUE and drop the other two.
These all still regress
We probably need to implement some reassociation folds for the intrinsics like instcombine's factorizeMinMaxTree():
D88287 might also help, but NaryReassociate isn't in the default optimization pipeline?