summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
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
commit02742710f36763ed6210f03012efc8262c177115 (patch)
treeade7c682b3f2cdf27b578aa459bf5e1cbc9ed4d2 /llvm/lib/Transforms
parent23e3fb9e83ffd64f4e04dc8d344f45a3c50554e2 (diff)
downloadbcm5719-llvm-02742710f36763ed6210f03012efc8262c177115.tar.gz
bcm5719-llvm-02742710f36763ed6210f03012efc8262c177115.zip
SCEVAddExpr::get() of an empty list is invalid.
llvm-svn: 22724
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index e20f4be998e..1fcc45a3a4b 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud