summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.katkov@azul.com>2018-01-22 07:47:02 +0000
committerSerguei Katkov <serguei.katkov@azul.com>2018-01-22 07:47:02 +0000
commitf38041dc3e51d1dd437b5fae852c27ffcc68c800 (patch)
tree409fe2180602087c39fb54769bc9d0d0c0cd5599 /llvm/lib
parent56939f7e75a753e47c34007648d39d27564cbed0 (diff)
downloadbcm5719-llvm-f38041dc3e51d1dd437b5fae852c27ffcc68c800.tar.gz
bcm5719-llvm-f38041dc3e51d1dd437b5fae852c27ffcc68c800.zip
Revert [SCEV] Fix isLoopEntryGuardedByCond usage
It causes buildbot failures. New added assert is fired. It seems not all usages of isLoopEntryGuardedByCond are fixed. llvm-svn: 323079
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp12
-rw-r--r--llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp19
2 files changed, 10 insertions, 21 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index e25247072c5..7a9fddfd10b 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8669,8 +8669,7 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
bool RightGuarded = false;
if (LAR) {
const Loop *L = LAR->getLoop();
- if (isAvailableAtLoopEntry(RHS, L) &&
- isLoopEntryGuardedByCond(L, Pred, LAR->getStart(), RHS) &&
+ if (isLoopEntryGuardedByCond(L, Pred, LAR->getStart(), RHS) &&
isLoopBackedgeGuardedByCond(L, Pred, LAR->getPostIncExpr(*this), RHS)) {
if (!RAR) return true;
LeftGuarded = true;
@@ -8678,8 +8677,7 @@ bool ScalarEvolution::isKnownPredicate(ICmpInst::Predicate Pred,
}
if (RAR) {
const Loop *L = RAR->getLoop();
- if (isAvailableAtLoopEntry(LHS, L) &&
- isLoopEntryGuardedByCond(L, Pred, LHS, RAR->getStart()) &&
+ if (isLoopEntryGuardedByCond(L, Pred, LHS, RAR->getStart()) &&
isLoopBackedgeGuardedByCond(L, Pred, LHS, RAR->getPostIncExpr(*this))) {
if (!LAR) return true;
RightGuarded = true;
@@ -9060,12 +9058,6 @@ bool
ScalarEvolution::isLoopEntryGuardedByCond(const Loop *L,
ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS) {
- // Both LHS and RHS must be available at loop entry.
- assert(isAvailableAtLoopEntry(LHS, L) &&
- "LHS is not available at Loop Entry");
- assert(isAvailableAtLoopEntry(RHS, L) &&
- "RHS is not available at Loop Entry");
-
// Interpret a null as meaning no loop, where there is obviously no guard
// (interprocedural conditions notwithstanding).
if (!L) return false;
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
index 1af77d84f85..c8e58a1e93a 100644
--- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
@@ -934,9 +934,9 @@ LoopStructure::parseLoopStructure(ScalarEvolution &SE,
return None;
}
- if (!SE.isAvailableAtLoopEntry(RightSCEV, &L) ||
- !SE.isLoopEntryGuardedByCond(&L, BoundPred, IndVarStart,
- SE.getAddExpr(RightSCEV, Step))) {
+ if (!SE.isLoopEntryGuardedByCond(
+ &L, BoundPred, IndVarStart,
+ SE.getAddExpr(RightSCEV, Step))) {
FailureReason = "Induction variable start not bounded by upper limit";
return None;
}
@@ -948,8 +948,7 @@ LoopStructure::parseLoopStructure(ScalarEvolution &SE,
RightValue = B.CreateAdd(RightValue, One);
}
} else {
- if (!SE.isAvailableAtLoopEntry(RightSCEV, &L) ||
- !SE.isLoopEntryGuardedByCond(&L, BoundPred, IndVarStart, RightSCEV)) {
+ if (!SE.isLoopEntryGuardedByCond(&L, BoundPred, IndVarStart, RightSCEV)) {
FailureReason = "Induction variable start not bounded by upper limit";
return None;
}
@@ -1015,10 +1014,9 @@ LoopStructure::parseLoopStructure(ScalarEvolution &SE,
return None;
}
- if (!SE.isAvailableAtLoopEntry(RightSCEV, &L) ||
- !SE.isLoopEntryGuardedByCond(
- &L, BoundPred, IndVarStart,
- SE.getMinusSCEV(RightSCEV, SE.getOne(RightSCEV->getType())))) {
+ if (!SE.isLoopEntryGuardedByCond(
+ &L, BoundPred, IndVarStart,
+ SE.getMinusSCEV(RightSCEV, SE.getOne(RightSCEV->getType())))) {
FailureReason = "Induction variable start not bounded by lower limit";
return None;
}
@@ -1030,8 +1028,7 @@ LoopStructure::parseLoopStructure(ScalarEvolution &SE,
RightValue = B.CreateSub(RightValue, One);
}
} else {
- if (!SE.isAvailableAtLoopEntry(RightSCEV, &L) ||
- !SE.isLoopEntryGuardedByCond(&L, BoundPred, IndVarStart, RightSCEV)) {
+ if (!SE.isLoopEntryGuardedByCond(&L, BoundPred, IndVarStart, RightSCEV)) {
FailureReason = "Induction variable start not bounded by lower limit";
return None;
}
OpenPOWER on IntegriCloud