This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Improve cost calculation in foldSelectICmpAndBinOp
Needs ReviewPublic

Authored by goldstein.w.n on Apr 14 2023, 11:12 PM.

Details

Summary

There is a case where we save an and instruction because the shift
is the entire bitwidth. So take that into account when accounting the
number of instruction with/without the transform.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Apr 14 2023, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 11:12 PM
goldstein.w.n requested review of this revision.Apr 14 2023, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 11:12 PM
nikic added a comment.Jul 10 2023, 3:41 AM

Is this useful?

Is this useful?

Its more precise at the very least. You think we are better of with the select in this case?
I'm fine dropping this if you think the even-fold isn't actually to our benefit.

ping. @nikic you think I should just drop this?