https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67438
--- Comment #7 from Alexander Fomin <afomin.mailbox at gmail dot com> --- Looks like a cost model should be introduced to avoid such kind of transformations for targets with HW min/max implementation.