summaryrefslogtreecommitdiffstats
path: root/polly/lib/Support/SCEVValidator.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-06-06 12:08:34 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-06-06 12:08:34 +0000
commit4b2fd892ec5873105bc3ca90d908ae8d1f08e05c (patch)
tree9f35b29a78c7488ad32d7154e6fa8bbf9e994519 /polly/lib/Support/SCEVValidator.cpp
parent0ca86fe84dc916b9af9c70c1d1163298e1928993 (diff)
downloadbcm5719-llvm-4b2fd892ec5873105bc3ca90d908ae8d1f08e05c.tar.gz
bcm5719-llvm-4b2fd892ec5873105bc3ca90d908ae8d1f08e05c.zip
[FIX] Do not recognize division by 0 as affine
llvm-svn: 271885
Diffstat (limited to 'polly/lib/Support/SCEVValidator.cpp')
-rw-r--r--polly/lib/Support/SCEVValidator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/Support/SCEVValidator.cpp b/polly/lib/Support/SCEVValidator.cpp
index eba4d0d27fe..85bf815a21d 100644
--- a/polly/lib/Support/SCEVValidator.cpp
+++ b/polly/lib/Support/SCEVValidator.cpp
@@ -307,7 +307,7 @@ public:
// First check if we might be able to model the division, thus if the
// divisor is constant. If so, check the dividend, otherwise check if
// the whole division can be seen as a parameter.
- if (isa<SCEVConstant>(Divisor))
+ if (isa<SCEVConstant>(Divisor) && !Divisor->isZero())
return visit(Dividend);
// For signed divisions use the SDiv instruction to check for a parameter
@@ -345,7 +345,7 @@ public:
auto *Divisor = SRem->getOperand(1);
auto *CI = dyn_cast<ConstantInt>(Divisor);
- if (!CI)
+ if (!CI || CI->isZeroValue())
return visitGenericInst(SRem, S);
auto *Dividend = SRem->getOperand(0);
OpenPOWER on IntegriCloud