summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 03759a18f17..84fece508a5 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4082,28 +4082,6 @@ SelectPatternResult llvm::matchSelectPattern(Value *V, Value *&LHS, Value *&RHS,
LHS, RHS);
}
-ConstantRange llvm::getConstantRangeFromMetadata(const MDNode &Ranges) {
- const unsigned NumRanges = Ranges.getNumOperands() / 2;
- assert(NumRanges >= 1 && "Must have at least one range!");
- assert(Ranges.getNumOperands() % 2 == 0 && "Must be a sequence of pairs");
-
- auto *FirstLow = mdconst::extract<ConstantInt>(Ranges.getOperand(0));
- auto *FirstHigh = mdconst::extract<ConstantInt>(Ranges.getOperand(1));
-
- ConstantRange CR(FirstLow->getValue(), FirstHigh->getValue());
-
- for (unsigned i = 1; i < NumRanges; ++i) {
- auto *Low = mdconst::extract<ConstantInt>(Ranges.getOperand(2 * i + 0));
- auto *High = mdconst::extract<ConstantInt>(Ranges.getOperand(2 * i + 1));
-
- // Note: unionWith will potentially create a range that contains values not
- // contained in any of the original N ranges.
- CR = CR.unionWith(ConstantRange(Low->getValue(), High->getValue()));
- }
-
- return CR;
-}
-
/// Return true if "icmp Pred LHS RHS" is always true.
static bool isTruePredicate(CmpInst::Predicate Pred,
const Value *LHS, const Value *RHS,
OpenPOWER on IntegriCloud