HomePhabricator

[InstCombine] Support non-splat vectors in icmp eq + add/sub fold

Authored by nikic on Jan 29 2020, 9:58 AM.

Description

[InstCombine] Support non-splat vectors in icmp eq + add/sub fold

For the

icmp eq (add X, C1), C2 => icmp eq X, C2-C1
icmp eq (sub C1, X), C2 => icmp eq X, C1-C2

folds, this allows C1 to be non-splat and contain undefs.
C2 is still splat, due to the structure of the code.

This is to address the remaining part of the regression in D73411,
where demanded element analysis replaces some elements with undef.

Differential Revision: https://reviews.llvm.org/D73647