summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2014-10-07 14:37:59 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2014-10-07 14:37:59 +0000
commit219b20e1a3d5438c4ba8a0ef22900d3587d0fc19 (patch)
tree4a0adaa781ab1f074d2bca385e9c3943b13dd050 /polly/lib/CodeGen
parent3cb6372762cfeca59bae715bf1067ae7e3d9d997 (diff)
downloadbcm5719-llvm-219b20e1a3d5438c4ba8a0ef22900d3587d0fc19.tar.gz
bcm5719-llvm-219b20e1a3d5438c4ba8a0ef22900d3587d0fc19.zip
[Fix] Non i1 typed select condition for weird pw aff functions.
In case the pieceweise affine function used to create an isl_ast_expr had empty cases (e.g., with contradicting constraints on the parameters), it was possible that the condition of the isl_ast_expr select was not a comparison but a constant (thus of type i64). This patch does two thing: 1) Handle the case the condition of a select is not a i1 type like C. 2) Try to simplify the pieceweise affine functions for the min/max access when we generate runtime alias checks. That step can often remove empty or redundant cases as well as redundant constrains. This fixes bug: http://llvm.org/PR21167 Differential Revision: http://reviews.llvm.org/D5627 llvm-svn: 219208
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r--polly/lib/CodeGen/IslExprBuilder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp
index 158288dca46..39a9bb6a0fe 100644
--- a/polly/lib/CodeGen/IslExprBuilder.cpp
+++ b/polly/lib/CodeGen/IslExprBuilder.cpp
@@ -249,6 +249,8 @@ Value *IslExprBuilder::createOpSelect(__isl_take isl_ast_expr *Expr) {
Type *MaxType = getType(Expr);
Cond = create(isl_ast_expr_get_op_arg(Expr, 0));
+ if (!Cond->getType()->isIntegerTy(1))
+ Cond = Builder.CreateIsNotNull(Cond);
LHS = create(isl_ast_expr_get_op_arg(Expr, 1));
RHS = create(isl_ast_expr_get_op_arg(Expr, 2));
OpenPOWER on IntegriCloud