summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp4
-rw-r--r--llvm/lib/Analysis/SparsePropagation.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 950d4a65378..e1c099e4356 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -854,8 +854,8 @@ bool LazyValueInfoCache::getEdgeValue(Value *Val, BasicBlock *BBFrom,
// BBFrom to BBTo.
unsigned NumEdges = 0;
ConstantInt *EdgeVal = 0;
- for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i) {
- if (SI->getSuccessor(i) != BBTo) continue;
+ for (unsigned i = 0, e = SI->getNumCases(); i != e; ++i) {
+ if (SI->getCaseSuccessor(i) != BBTo) continue;
if (NumEdges++) break;
EdgeVal = SI->getCaseValue(i);
}
diff --git a/llvm/lib/Analysis/SparsePropagation.cpp b/llvm/lib/Analysis/SparsePropagation.cpp
index 035bceaf270..0c7d05f91da 100644
--- a/llvm/lib/Analysis/SparsePropagation.cpp
+++ b/llvm/lib/Analysis/SparsePropagation.cpp
@@ -195,7 +195,8 @@ void SparseSolver::getFeasibleSuccessors(TerminatorInst &TI,
return;
}
- Succs[SI.findCaseValue(cast<ConstantInt>(C))] = true;
+ unsigned CCase = SI.findCaseValue(cast<ConstantInt>(C));
+ Succs[SI.resolveSuccessorIndex(CCase)] = true;
}
OpenPOWER on IntegriCloud