summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslExprBuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/IslExprBuilder.cpp')
-rw-r--r--polly/lib/CodeGen/IslExprBuilder.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp
index 7b5b8e005e4..d1e4e9667b1 100644
--- a/polly/lib/CodeGen/IslExprBuilder.cpp
+++ b/polly/lib/CodeGen/IslExprBuilder.cpp
@@ -280,13 +280,16 @@ Value *IslExprBuilder::createOpICmp(__isl_take isl_ast_expr *Expr) {
LHS = create(isl_ast_expr_get_op_arg(Expr, 0));
RHS = create(isl_ast_expr_get_op_arg(Expr, 1));
- bool IsPtrType = LHS->getType()->isPointerTy();
- assert((!IsPtrType || RHS->getType()->isPointerTy()) &&
- "Both ICmp operators should be pointer types or none of them");
+ bool IsPtrType =
+ LHS->getType()->isPointerTy() || RHS->getType()->isPointerTy();
if (LHS->getType() != RHS->getType()) {
if (IsPtrType) {
Type *I8PtrTy = Builder.getInt8PtrTy();
+ if (!LHS->getType()->isPointerTy())
+ LHS = Builder.CreateIntToPtr(LHS, I8PtrTy);
+ if (!RHS->getType()->isPointerTy())
+ RHS = Builder.CreateIntToPtr(RHS, I8PtrTy);
if (LHS->getType() != I8PtrTy)
LHS = Builder.CreateBitCast(LHS, I8PtrTy);
if (RHS->getType() != I8PtrTy)
OpenPOWER on IntegriCloud