summaryrefslogtreecommitdiffstats
path: root/polly/lib
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2013-04-14 13:15:59 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2013-04-14 13:15:59 +0000
commit3ed2600cab77aef99f2b8975b67682c5149b1134 (patch)
tree9c6fe6f77b6efa33cbb4b7ec601e4e8694248683 /polly/lib
parent50ba983d25c0885745bd0502ecc03e65f408440e (diff)
downloadbcm5719-llvm-3ed2600cab77aef99f2b8975b67682c5149b1134.tar.gz
bcm5719-llvm-3ed2600cab77aef99f2b8975b67682c5149b1134.zip
SCEVValidator: Correctly store 'k * p' as a parameter
We do not only need to understand that 'k * p' is a parameter expression, but also need to store this expression in the set of parameters. Before this patch we wrongly stored the two individual parameters %k and %p. Reported by: Sebastian Pop <spop@codeaurora.org> llvm-svn: 179485
Diffstat (limited to 'polly/lib')
-rw-r--r--polly/lib/Support/SCEVValidator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/polly/lib/Support/SCEVValidator.cpp b/polly/lib/Support/SCEVValidator.cpp
index a739f3b4c90..80b8a08b6f4 100644
--- a/polly/lib/Support/SCEVValidator.cpp
+++ b/polly/lib/Support/SCEVValidator.cpp
@@ -202,6 +202,8 @@ public:
class ValidatorResult visitMulExpr(const SCEVMulExpr *Expr) {
ValidatorResult Return(SCEVType::INT);
+ bool HasMultipleParams = false;
+
for (int i = 0, e = Expr->getNumOperands(); i < e; ++i) {
ValidatorResult Op = visit(Expr->getOperand(i));
@@ -209,7 +211,7 @@ public:
continue;
if (Op.isPARAM() && Return.isPARAM()) {
- Return.merge(Op);
+ HasMultipleParams = true;
continue;
}
@@ -226,6 +228,9 @@ public:
Return.merge(Op);
}
+ if (HasMultipleParams)
+ return ValidatorResult(SCEVType::PARAM, Expr);
+
// TODO: Check for NSW and NUW.
return Return;
}
OpenPOWER on IntegriCloud