This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by spatel on May 8 2017, 10:08 AM.

Details

Summary

This is the InstCombine counterpart to D32954. I added some comments about the code duplication in:
rL302436

Alive-based verification:
http://rise4fun.com/Alive/dPw

This is a 2nd fix for the problem reported in:
https://bugs.llvm.org/show_bug.cgi?id=32949

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.May 8 2017, 10:08 AM
This revision is now accepted and ready to land.May 15 2017, 10:43 AM
davide accepted this revision.May 15 2017, 10:47 AM

This is the same as the other no? If so, LGTM.

This is the same as the other no? If so, LGTM.

Yep - the logic is unfortunately duplicated in InstCombine and InstSimplify, so we need 2 patches to solve the bug completely. Since this is a miscompile, I thought it was better to get the fixes in and then think about refactoring to eliminate that duplication.

This revision was automatically updated to reflect the committed changes.