aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-09 01:13:47 +0000
committerChris Lattner <sabre@nondot.org>2005-08-09 01:13:47 +0000
commitb965ee5914bb9cdfd1500f29a4a5aa2a128e69c1 (patch)
tree12eb16b1bfa26ad573dc911569e5c29031fc9730 /lib/Transforms/Scalar/LoopStrengthReduce.cpp
parentbf9af65a9386836eee0eb549304b904d145c7e93 (diff)
SCEVAddExpr::get() of an empty list is invalid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index e20f4be998..1fcc45a3a4 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -608,7 +608,10 @@ RemoveCommonExpressionsFromUseBases(std::vector<BasedUser> &Uses) {
for (unsigned j = 0, e = AE->getNumOperands(); j != e; ++j)
if (!SubExpressionUseCounts.count(AE->getOperand(j)))
NewOps.push_back(AE->getOperand(j));
- Uses[i].Base = SCEVAddExpr::get(NewOps);
+ if (NewOps.size() == 0)
+ Uses[i].Base = Zero;
+ else
+ Uses[i].Base = SCEVAddExpr::get(NewOps);
} else {
// If the base is zero (which is common), return zero now, there are no
// CSEs we can find.