This is an archive of the discontinued LLVM Phabricator instance.

InstCombine: Fold select of ldexp to ldexp of select
ClosedPublic

Authored by arsenm on May 17 2023, 2:50 AM.

Details

Summary

The select-of-different-exp pattern appears in the device
libraries. I haven't seen the select-of-values case.

Diff Detail

Event Timeline

arsenm created this revision.May 17 2023, 2:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2023, 2:50 AM
arsenm requested review of this revision.May 17 2023, 2:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2023, 2:50 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 522976.May 17 2023, 2:53 AM

Flag guard is overkill for one instruction

nikic added a subscriber: nikic.May 17 2023, 2:54 AM

Should be part of foldSelectOpOp()?

arsenm updated this revision to Diff 523347.May 18 2023, 5:11 AM

Move to foldSelectOpOp, which has slightly more liberal hasOneUse checks

kpn added inline comments.Jun 9 2023, 8:39 AM
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
3340

Is this leftover from a previous version of the patch?

arsenm updated this revision to Diff 532301.Jun 16 2023, 3:05 PM

Remove leftover

kpn accepted this revision.Jun 19 2023, 11:09 AM

LGTM

This revision is now accepted and ready to land.Jun 19 2023, 11:09 AM