summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2016-08-11 22:23:07 +0000
committerPete Cooper <peter_cooper@apple.com>2016-08-11 22:23:07 +0000
commitfa7ae4f3b6316e60de4e3d9f4dd1f355889f970c (patch)
tree1047fbbcb432950a0e3e7c61bbe0d5c46d6f7b04
parent0d955d0bf5cbbd50061309ad2c08c0dcf8f62039 (diff)
downloadbcm5719-llvm-fa7ae4f3b6316e60de4e3d9f4dd1f355889f970c.tar.gz
bcm5719-llvm-fa7ae4f3b6316e60de4e3d9f4dd1f355889f970c.zip
Remove unnecessary extra version of isValidAssumeForContext. NFC.
There were 2 versions of this method. A public one which takes a const Instruction* and a private implementation which takes a mutable Value* and casts to an Instruction*. There was no need for the 2 versions as all callers pass a const Instruction* and there was no need for a mutable pointer as we only do analysis here. llvm-svn: 278434
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ac7dabec450..97c49310db2 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -398,7 +398,7 @@ void llvm::computeKnownBitsFromRangeMetadata(const MDNode &Ranges,
}
}
-static bool isEphemeralValueOf(Instruction *I, const Value *E) {
+static bool isEphemeralValueOf(const Instruction *I, const Value *E) {
SmallVector<const Value *, 16> WorkSet(1, I);
SmallPtrSet<const Value *, 32> Visited;
SmallPtrSet<const Value *, 16> EphValues;
@@ -455,9 +455,9 @@ static bool isAssumeLikeIntrinsic(const Instruction *I) {
return false;
}
-static bool isValidAssumeForContext(Value *V, const Instruction *CxtI,
- const DominatorTree *DT) {
- Instruction *Inv = cast<Instruction>(V);
+bool llvm::isValidAssumeForContext(const Instruction *Inv,
+ const Instruction *CxtI,
+ const DominatorTree *DT) {
// There are two restrictions on the use of an assume:
// 1. The assume must dominate the context (or the control flow must
@@ -491,7 +491,7 @@ static bool isValidAssumeForContext(Value *V, const Instruction *CxtI,
} else if (Inv->getParent() == CxtI->getParent()) {
// Search forward from the assume until we reach the context (or the end
// of the block); the common case is that the assume will come first.
- for (BasicBlock::iterator I = std::next(BasicBlock::iterator(Inv)),
+ for (auto I = std::next(BasicBlock::const_iterator(Inv)),
IE = Inv->getParent()->end(); I != IE; ++I)
if (&*I == CxtI)
return true;
@@ -509,12 +509,6 @@ static bool isValidAssumeForContext(Value *V, const Instruction *CxtI,
return false;
}
-bool llvm::isValidAssumeForContext(const Instruction *I,
- const Instruction *CxtI,
- const DominatorTree *DT) {
- return ::isValidAssumeForContext(const_cast<Instruction *>(I), CxtI, DT);
-}
-
static void computeKnownBitsFromAssume(Value *V, APInt &KnownZero,
APInt &KnownOne, unsigned Depth,
const Query &Q) {
OpenPOWER on IntegriCloud