HomePhabricator

[X86] - Catch extra combine opportunities for redundant imuls.

Description

[X86] - Catch extra combine opportunities for redundant imuls.

When we fold "mul ((add x, c1), c1)" -> "add ((mul x, c2), c1*c2)", we bail if (add x, c1) has multiple
users which would result in an extra add instruction.
In such cases, this patch adds a check to see if we can eliminate a multiply instruction in exchange for the extra add.

I also added the capability of doing the existing optimization with non-splatted vectors (splatted also works).

Differential Revision: http://reviews.llvm.org/D13740

Details

Committed
zansariOct 22 2015, 9:14 AM
Differential Revision
D13740: Catch combine opportunities for redundant imuls
Parents
rL251027: [PPC] Fix PR24686 by failing assembly for an invalid relocation
Branches
Unknown
Tags
Unknown