diff options
author | Tobias Grosser <tobias@grosser.es> | 2016-08-04 13:57:29 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2016-08-04 13:57:29 +0000 |
commit | f919d8b36071bdacd699e28d7788bb904ba5f23d (patch) | |
tree | 7db27beb7f29bd741542c7f1fd2c9e20dd7eea4a /polly/lib/CodeGen/IslExprBuilder.cpp | |
parent | f679530ba18023d29765bde397fa77048bf17985 (diff) | |
download | bcm5719-llvm-f919d8b36071bdacd699e28d7788bb904ba5f23d.tar.gz bcm5719-llvm-f919d8b36071bdacd699e28d7788bb904ba5f23d.zip |
GPGPU: Support scalars that are mapped to shared memory
llvm-svn: 277726
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)); |