This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] foldICmpWithLowBitMaskedVal(): handle uncanonical ((-1 << y) >> y) mask
ClosedPublic

Authored by lebedev.ri on Sep 16 2018, 6:06 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel accepted this revision.Sep 18 2018, 10:20 AM

Copying from D52147:
As discussed in D52146, this is a close call. We don't have evidence to suggest that the non-canonical pattern occurs often in real code, but it was spotted somewhere in the wild, and it's nice that we can fold this pattern regardless of extra uses. OTOH, instcombine keeps growing bigger and slower. But given past policy in these situations, we don't block tiny patches like this just because the fold is unlikely, so LGTM.

This revision is now accepted and ready to land.Sep 18 2018, 10:20 AM
This revision was automatically updated to reflect the committed changes.