This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] restrict icmp fold with 2 sdiv exact operands (PR32949)
ClosedPublic

Authored by spatel on May 7 2017, 11:51 AM.

Details

Summary

These folds were introduced with https://reviews.llvm.org/rL127064 as part of solving:
https://bugs.llvm.org/show_bug.cgi?id=9343

As shown here:
http://rise4fun.com/Alive/C8
...however, the sdiv exact case needs a stronger predicate.

I opted for duplicated code instead of adding another fallthrough because I think that's easier to read (and edit in case we need/want to restrict/loosen the predicates any more).

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=32949
https://bugs.llvm.org/show_bug.cgi?id=32948

Diff Detail

Repository
rL LLVM