[llvm-commits] [llvm] r76504 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Mon Jul 20 16:53:36 PDT 2009
Author: djg
Date: Mon Jul 20 18:53:35 2009
New Revision: 76504
URL: http://llvm.org/viewvc/llvm-project?rev=76504&view=rev
Log:
Remove the code that tried to evaluate whether (A pred B) is known
by determining if (B pred (B-A)) is known, as it doesn't handle
overflow correctly.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=76504&r1=76503&r2=76504&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 20 18:53:35 2009
@@ -4274,20 +4274,6 @@
return true;
if (LHSRange.getSignedMin().sge(RHSRange.getSignedMax()))
return false;
-
- const SCEV *Diff = getMinusSCEV(LHS, RHS);
- ConstantRange DiffRange = getUnsignedRange(Diff);
- if (isKnownNegative(Diff)) {
- if (DiffRange.getUnsignedMax().ult(LHSRange.getUnsignedMin()))
- return true;
- if (DiffRange.getUnsignedMin().uge(LHSRange.getUnsignedMax()))
- return false;
- } else if (isKnownPositive(Diff)) {
- if (LHSRange.getUnsignedMax().ult(DiffRange.getUnsignedMin()))
- return true;
- if (LHSRange.getUnsignedMin().uge(DiffRange.getUnsignedMax()))
- return false;
- }
break;
}
case ICmpInst::ICMP_SGE:
@@ -4300,20 +4286,6 @@
return true;
if (LHSRange.getSignedMin().sgt(RHSRange.getSignedMax()))
return false;
-
- const SCEV *Diff = getMinusSCEV(LHS, RHS);
- ConstantRange DiffRange = getUnsignedRange(Diff);
- if (isKnownNonPositive(Diff)) {
- if (DiffRange.getUnsignedMax().ule(LHSRange.getUnsignedMin()))
- return true;
- if (DiffRange.getUnsignedMin().ugt(LHSRange.getUnsignedMax()))
- return false;
- } else if (isKnownNonNegative(Diff)) {
- if (LHSRange.getUnsignedMax().ule(DiffRange.getUnsignedMin()))
- return true;
- if (LHSRange.getUnsignedMin().ugt(DiffRange.getUnsignedMax()))
- return false;
- }
break;
}
case ICmpInst::ICMP_UGT:
@@ -4326,13 +4298,6 @@
return true;
if (LHSRange.getUnsignedMin().uge(RHSRange.getUnsignedMax()))
return false;
-
- const SCEV *Diff = getMinusSCEV(LHS, RHS);
- ConstantRange DiffRange = getUnsignedRange(Diff);
- if (LHSRange.getUnsignedMax().ult(DiffRange.getUnsignedMin()))
- return true;
- if (LHSRange.getUnsignedMin().uge(DiffRange.getUnsignedMax()))
- return false;
break;
}
case ICmpInst::ICMP_UGE:
@@ -4345,13 +4310,6 @@
return true;
if (LHSRange.getUnsignedMin().ugt(RHSRange.getUnsignedMax()))
return false;
-
- const SCEV *Diff = getMinusSCEV(LHS, RHS);
- ConstantRange DiffRange = getUnsignedRange(Diff);
- if (LHSRange.getUnsignedMax().ule(DiffRange.getUnsignedMin()))
- return true;
- if (LHSRange.getUnsignedMin().ugt(DiffRange.getUnsignedMax()))
- return false;
break;
}
case ICmpInst::ICMP_NE: {
More information about the llvm-commits
mailing list