HomePhabricator

[InstCombine] Fold (x + C1) * (-1<<C2) --> (-C1 - x) * (1<<C2)

Authored by lebedev.ri on Aug 6 2020, 1:04 PM.

Description

[InstCombine] Fold (x + C1) * (-1<<C2) --> (-C1 - x) * (1<<C2)

Negator knows how to do this, but the one-use reasoning is getting
a bit muddy here, we don't really want to increase instruction count,
so we need to both lie that "IsNegation" and have an one-use check
on the outermost LHS value.

Details

Committed
lebedev.riAug 6 2020, 1:40 PM
Parents
rG0c1c756a3153: [InstCombine] Generalize %x * (-1<<C) --> (-%x) * (1<<C) fold
Branches
Unknown
Tags
Unknown