HomePhabricator

[InstCombine] Negator: -(cond ? x : -x) --> cond ? -x : x

Authored by lebedev.ri on Aug 5 2020, 11:20 AM.

Description

[InstCombine] Negator: -(cond ? x : -x) --> cond ? -x : x

We were errneously only doing that for old-style abs/nabs,
but we have no such legality check on the condition of the select.

https://rise4fun.com/Alive/xBHS

Details