This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Folding multiuse `(icmp eq/ne (or X, Y), Y)` for 2 uses of `Y`
AbandonedPublic

Authored by goldstein.w.n on Aug 28 2023, 9:30 PM.

Details

Summary

The fold will replace 2 uses of Y we should also do fold if Y has
2 uses (not only oneuse).

Diff Detail

Event Timeline

goldstein.w.n created this revision.Aug 28 2023, 9:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 9:30 PM
goldstein.w.n requested review of this revision.Aug 28 2023, 9:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 9:30 PM
nikic accepted this revision.Aug 29 2023, 3:23 AM

LGTM

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
4666

This would be the usual pattern...

This revision is now accepted and ready to land.Aug 29 2023, 3:23 AM
goldstein.w.n marked an inline comment as done.Sep 13 2023, 12:54 PM

Update with nikic's suggestion

goldstein.w.n abandoned this revision.Sep 19 2023, 9:11 AM

Abandoning and resubmitting on GH