Extract out getConstantRangeFromMetadata; NFC
authorSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 24 Oct 2015 05:37:35 +0000 (05:37 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Sat, 24 Oct 2015 05:37:35 +0000 (05:37 +0000)
commit5dacfa466d3a3b3c8deddb31969381600fb5c320
treea04564a28921e46dfcc5f848ed36e6defcc977b4
parentb4c96f7993851536d61a0ceb602c4e797dca9999
Extract out getConstantRangeFromMetadata; NFC

The loop idiom creating a ConstantRange is repeated twice in the
codebase, time to give it a name and a home.

The loop is also repeated in `rangeMetadataExcludesValue`, but using
`getConstantRangeFromMetadata` there would not be an NFC -- the range
returned by `getConstantRangeFromMetadata` may contain a value that none
of the subranges did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251180 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ValueTracking.h
lib/Analysis/InstructionSimplify.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ValueTracking.cpp