diff options
Diffstat (limited to 'polly/lib/CodeGen/IslExprBuilder.cpp')
-rw-r--r-- | polly/lib/CodeGen/IslExprBuilder.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp index 75e35076dde..30f4b0b4b29 100644 --- a/polly/lib/CodeGen/IslExprBuilder.cpp +++ b/polly/lib/CodeGen/IslExprBuilder.cpp @@ -212,7 +212,7 @@ Value *IslExprBuilder::createAccessAddress(isl_ast_expr *Expr) { "isl ast expression not of type isl_ast_op"); assert(isl_ast_expr_get_op_type(Expr) == isl_ast_op_access && "not an access isl ast expression"); - assert(isl_ast_expr_get_op_n_arg(Expr) >= 2 && + assert(isl_ast_expr_get_op_n_arg(Expr) >= 1 && "We need at least two operands to create a member access."); Value *Base, *IndexOp, *Access; @@ -250,6 +250,11 @@ Value *IslExprBuilder::createAccessAddress(isl_ast_expr *Expr) { Builder.CreateBitCast(Base, PointerTy, "polly.access.cast." + BaseName); } + if (isl_ast_expr_get_op_n_arg(Expr) == 1) { + isl_ast_expr_free(Expr); + return Base; + } + IndexOp = nullptr; for (unsigned u = 1, e = isl_ast_expr_get_op_n_arg(Expr); u < e; u++) { Value *NextIndex = create(isl_ast_expr_get_op_arg(Expr, u)); |