This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Use ConstantRange based overflow check for signed sub
ClosedPublic

Authored by nikic on Mar 20 2019, 2:46 PM.

Details

Summary

This is D59450, but for signed sub. This case is not NFC, because the overflow logic in ConstantRange is more powerful than the existing check. This resolves the TODO in the function.

I've added two tests to show that this indeed catches more cases than the previous logic, but the main correctness test coverage here is in the existing ConstantRange unit tests.

Diff Detail

Repository
rL LLVM

Event Timeline

nikic created this revision.Mar 20 2019, 2:46 PM
This revision is now accepted and ready to land.Mar 21 2019, 5:31 AM
This revision was automatically updated to reflect the committed changes.