diff options
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r-- | polly/lib/CodeGen/IslCodeGeneration.cpp | 3 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslExprBuilder.cpp | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp index 34043782e9b..9fc101db6e3 100644 --- a/polly/lib/CodeGen/IslCodeGeneration.cpp +++ b/polly/lib/CodeGen/IslCodeGeneration.cpp @@ -871,8 +871,7 @@ void IslNodeBuilder::addParameters(__isl_take isl_set *Context) { Value *IslNodeBuilder::generateSCEV(const SCEV *Expr) { Instruction *InsertLocation = --(Builder.GetInsertBlock()->end()); - return Rewriter->expandCodeFor(Expr, cast<IntegerType>(Expr->getType()), - InsertLocation); + return Rewriter->expandCodeFor(Expr, Expr->getType(), InsertLocation); } namespace { 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) |