This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Add vector support to icmp(add(X,C1),add(Y,C2)) -> icmp(add(X,C1-C2),Y) fold
ClosedPublic

Authored by RKSimon on Mar 10 2022, 1:26 AM.

Details

Summary

As discussed on Issue #32161, this fold can be generalized a lot more than it currently is, but this patch at least adds vector support.

Diff Detail

Event Timeline

RKSimon created this revision.Mar 10 2022, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 1:26 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon requested review of this revision.Mar 10 2022, 1:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2022, 1:26 AM
lebedev.ri accepted this revision.Mar 10 2022, 4:13 AM

Seems pretty straight-forward to me, thanks.

llvm/test/Transforms/InstCombine/icmp.ll
1645–1646

If some channel is undef in both constants, it can be undef in the new constant.
https://alive2.llvm.org/ce/z/XJTfst

This revision is now accepted and ready to land.Mar 10 2022, 4:13 AM
This revision was landed with ongoing or failed builds.Mar 10 2022, 5:31 AM
This revision was automatically updated to reflect the committed changes.