HomePhabricator

[InstCombine] Negator: don't negate multi-use `sub`

Authored by lebedev.ri on Apr 23 2020, 11:07 AM.

Description

[InstCombine] Negator: don't negate multi-use sub

While we can do that, it doesn't increase instruction count,
if the old sub sticks around then the transform is not only
not a unlikely win, but a likely regression, since we likely
now extended live range and use count of both of the sub operands,
as opposed to just the result of sub.

As Kostya Serebryany notes in post-commit review in
https://reviews.llvm.org/D68408#1998112
this indeed can degrade final assembly,
increase register pressure, and spilling.

This isn't what we want here,
so at least for now let's guard it with an use check.

Details

Committed
lebedev.riApr 23 2020, 1:59 PM
Parents
rG7ca56c90bd6e: [SVE] Remove calls to isScalable from Transforms
Branches
Unknown
Tags
Unknown