summaryrefslogtreecommitdiff
path: root/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2010-09-02 22:16:52 +0000
committerOwen Anderson <resistor@mac.com>2010-09-02 22:16:52 +0000
commit4caef6001d2180a707ab42f4986f9941d5d0248b (patch)
treeab7521287aefc62b8a55e2b6fb6f84cf4cab9ed7 /lib/Analysis/LazyValueInfo.cpp
parent2f4fad99ea776906c853f0c4eef0eb0f7d2dc579 (diff)
downloadllvm-4caef6001d2180a707ab42f4986f9941d5d0248b.tar.gz
llvm-4caef6001d2180a707ab42f4986f9941d5d0248b.tar.bz2
llvm-4caef6001d2180a707ab42f4986f9941d5d0248b.tar.xz
Remove incorrect and poorly tested code for trying to reason about values on default edges of
switches. Just return the conservatively correct answer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--lib/Analysis/LazyValueInfo.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/Analysis/LazyValueInfo.cpp b/lib/Analysis/LazyValueInfo.cpp
index ff98bf9771..b4923f9a71 100644
--- a/lib/Analysis/LazyValueInfo.cpp
+++ b/lib/Analysis/LazyValueInfo.cpp
@@ -670,25 +670,11 @@ LVILatticeVal LVIQuery::getEdgeValue(BasicBlock *BBFrom, BasicBlock *BBTo) {
// If the edge was formed by a switch on the value, then we may know exactly
// what it is.
if (SwitchInst *SI = dyn_cast<SwitchInst>(BBFrom->getTerminator())) {
- // If BBTo is the default destination of the switch, we know that it
- // doesn't have the same value as any of the cases.
if (SI->getCondition() == Val) {
+ // We don't know anything in the default case.
if (SI->getDefaultDest() == BBTo) {
- const IntegerType *IT = cast<IntegerType>(Val->getType());
- ConstantRange CR(IT->getBitWidth());
-
- for (unsigned i = 1, e = SI->getNumSuccessors(); i != e; ++i) {
- const APInt CaseVal = SI->getCaseValue(i)->getValue();
- ConstantRange CaseRange(CaseVal, CaseVal+1);
- CaseRange = CaseRange.inverse();
- CR = CR.intersectWith(CaseRange);
- }
-
LVILatticeVal Result;
- if (CR.isFullSet() || CR.isEmptySet())
- Result.markOverdefined();
- else
- Result.markConstantRange(CR);
+ Result.markOverdefined();
return Result;
}