summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2019-06-11 23:21:24 +0000
committerPhilip Reames <listmail@philipreames.com>2019-06-11 23:21:24 +0000
commit02f0b379f56319eb49424bdfb96d567454cc77c5 (patch)
treeadf76b99c91767f585fd01d1d4eef5b29a9a7dae /llvm/lib/Analysis/ScalarEvolution.cpp
parent0e9b1d2a20c5cad342ffa9344df02d1d9dbb08a6 (diff)
downloadbcm5719-llvm-02f0b379f56319eb49424bdfb96d567454cc77c5.tar.gz
bcm5719-llvm-02f0b379f56319eb49424bdfb96d567454cc77c5.zip
Fix a bug in getSCEVAtScope w.r.t. non-canonical loops
The issue is that if we have a loop with multiple predecessors outside the loop, the code was expecting to merge them and only return if equal, but instead returned the first one seen. I have no idea if this actually tripped anywhere. I noticed it by accident when reading the code and have no idea how to go about constructing a test case. llvm-svn: 363112
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index a7b7fa26238..dc2d32856cc 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8126,9 +8126,9 @@ const SCEV *ScalarEvolution::computeSCEVAtScope(const SCEV *V, const Loop *L) {
break;
}
}
- if (!MultipleInitValues && InitValue)
- return getSCEV(InitValue);
}
+ if (!MultipleInitValues && InitValue)
+ return getSCEV(InitValue);
}
// Okay, we know how many times the containing loop executes. If
// this is a constant evolving PHI node, get the final value at
OpenPOWER on IntegriCloud