This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] add icmp fold with or mask of low bits (PR32542)
ClosedPublic

Authored by spatel on Apr 5 2017, 9:47 AM.

Details

Summary

We already have these 'and' folds:

// X & -C == -C -> X >  u ~C
// X & -C != -C -> X <= u ~C
//   iff C is a power of 2

...but we were missing the 'or' siblings.

http://rise4fun.com/Alive/n6

This should improve:
https://bugs.llvm.org/show_bug.cgi?id=32524
...but there are 2 or more other pieces to fix still.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Apr 5 2017, 9:47 AM
efriedma accepted this revision.Apr 5 2017, 10:39 AM

LGTM.

This revision is now accepted and ready to land.Apr 5 2017, 10:39 AM
This revision was automatically updated to reflect the committed changes.