summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Bhat <siddu.druid@gmail.com>2017-07-24 09:08:21 +0000
committerSiddharth Bhat <siddu.druid@gmail.com>2017-07-24 09:08:21 +0000
commitf7face4bc435ee608f9e3d2322781d3298ff59b3 (patch)
tree0d0b0100f8a19135f82b9783c1d685505cc29921
parent35de9009171efc3179c8c8c860783b704186c305 (diff)
downloadbcm5719-llvm-f7face4bc435ee608f9e3d2322781d3298ff59b3.tar.gz
bcm5719-llvm-f7face4bc435ee608f9e3d2322781d3298ff59b3.zip
Convert GPUNodeBuilder::getArraySize to islcpp.
Note: PPCGCodeGeneration::pollyBuildAstExprForStmt is at https://reviews.llvm.org/D35770 Differential Revision: https://reviews.llvm.org/D35771 llvm-svn: 308870
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index aef08846352..897bb417a9b 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1015,25 +1015,28 @@ static bool isPrefix(std::string String, std::string Prefix) {
}
Value *GPUNodeBuilder::getArraySize(gpu_array_info *Array) {
- isl_ast_build *Build = isl_ast_build_from_context(S.getContext());
+ isl::ast_build Build =
+ isl::ast_build::from_context(isl::manage(S.getContext()));
Value *ArraySize = ConstantInt::get(Builder.getInt64Ty(), Array->size);
if (!gpu_array_is_scalar(Array)) {
- auto OffsetDimZero = isl_multi_pw_aff_get_pw_aff(Array->bound, 0);
- isl_ast_expr *Res = isl_ast_build_expr_from_pw_aff(Build, OffsetDimZero);
+ isl::multi_pw_aff ArrayBound =
+ isl::manage(isl_multi_pw_aff_copy(Array->bound));
+
+ isl::pw_aff OffsetDimZero = ArrayBound.get_pw_aff(0);
+ isl::ast_expr Res = Build.expr_from(OffsetDimZero);
for (unsigned int i = 1; i < Array->n_index; i++) {
- isl_pw_aff *Bound_I = isl_multi_pw_aff_get_pw_aff(Array->bound, i);
- isl_ast_expr *Expr = isl_ast_build_expr_from_pw_aff(Build, Bound_I);
- Res = isl_ast_expr_mul(Res, Expr);
+ isl::pw_aff Bound_I = ArrayBound.get_pw_aff(i);
+ isl::ast_expr Expr = Build.expr_from(Bound_I);
+ Res = Res.mul(Expr);
}
- Value *NumElements = ExprBuilder.create(Res);
+ Value *NumElements = ExprBuilder.create(Res.release());
if (NumElements->getType() != ArraySize->getType())
NumElements = Builder.CreateSExt(NumElements, ArraySize->getType());
ArraySize = Builder.CreateMul(ArraySize, NumElements);
}
- isl_ast_build_free(Build);
return ArraySize;
}
OpenPOWER on IntegriCloud