This is an archive of the discontinued LLVM Phabricator instance.

Factor out common parts of LVI and Float2Int into ConstantRange [NFCI]
ClosedPublic

Authored by reames on Nov 30 2016, 10:28 PM.

Details

Summary

This just extracts out the transfer rules for constant ranges into a single shared point. As it happens, neither bit of code actually overlaps in terms of the handled operators, but with this change that could easily be tweaked in the future.

I also want to have this separated out to make experimenting with a eager value info implementation and possibly a ValueTracking-like fixed depth recursion peephole version. There's no reason all four of these can't share a common implementation which reduces the chances of bugs.

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 79867.Nov 30 2016, 10:28 PM
reames retitled this revision from to Factor out common parts of LVI and Float2Int into ConstantRange [NFCI].
reames updated this object.
reames added reviewers: jmolloy, sanjoy, apilipenko.
reames added a subscriber: llvm-commits.
jmolloy accepted this revision.Dec 1 2016, 10:36 AM
jmolloy edited edge metadata.

LGTM!

include/llvm/IR/ConstantRange.h
243 ↗(On Diff #79867)

Indentation malfunction.

This revision is now accepted and ready to land.Dec 1 2016, 10:36 AM
This revision was automatically updated to reflect the committed changes.