summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2016-06-03 18:51:48 +0000
committerMichael Kruse <llvm@meinersbur.de>2016-06-03 18:51:48 +0000
commit5c527f9963cb31bef117a7421c4480b2a59a7ce2 (patch)
tree4d4d94d649b313b094a0b9fc738d8991e9d07749 /polly/lib/CodeGen
parent6f6d012e32e8336c6d8668000c2855c08ac8bd8e (diff)
downloadbcm5719-llvm-5c527f9963cb31bef117a7421c4480b2a59a7ce2.tar.gz
bcm5719-llvm-5c527f9963cb31bef117a7421c4480b2a59a7ce2.zip
Fix modulo compared to zero.
In case of modulo compared to zero, we need to do signed modulo operation as unsigned can give different results based on whether the dividend is negative or not. This addresses llvm.org/PR27707 Contributed-by: Chris Jenneisch <chrisj@codeaurora.org> Reviewers: _jdoerfert, grosser, Meinersbur Differential Revision: http://reviews.llvm.org/D20145 llvm-svn: 271707
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r--polly/lib/CodeGen/IslExprBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp
index ba616562982..7dcc6518cb1 100644
--- a/polly/lib/CodeGen/IslExprBuilder.cpp
+++ b/polly/lib/CodeGen/IslExprBuilder.cpp
@@ -352,7 +352,7 @@ Value *IslExprBuilder::createOpBin(__isl_take isl_ast_expr *Expr) {
break;
case isl_ast_op_zdiv_r: // Result only compared against zero
- Res = Builder.CreateURem(LHS, RHS, "pexp.zdiv_r");
+ Res = Builder.CreateSRem(LHS, RHS, "pexp.zdiv_r");
break;
}
OpenPOWER on IntegriCloud