Factor out common parts of LVI and Float2Int into ConstantRange [NFCI]
authorPhilip Reames <listmail@philipreames.com>
Thu, 1 Dec 2016 20:08:47 +0000 (20:08 +0000)
committerPhilip Reames <listmail@philipreames.com>
Thu, 1 Dec 2016 20:08:47 +0000 (20:08 +0000)
commit4d00af1bde7a9db210fe80bb7207832112ef9394
tree90852477eaa4e8038de7aea741ae1ac4b205b316
parent2c01af590457dad514c8998f8c950c15319e2077
Factor out common parts of LVI and Float2Int into ConstantRange [NFCI]

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.

Differential Revision: https://reviews.llvm.org/D27294

llvm-svn: 288413
llvm/include/llvm/IR/ConstantRange.h
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/lib/IR/ConstantRange.cpp
llvm/lib/Transforms/Scalar/Float2Int.cpp