diff options
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index b606828069e..c6c8db8a911 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -2261,7 +2261,7 @@ void GPUNodeBuilder::createKernelVariables(ppcg_kernel *Kernel, Function *FN) { } SAI = S.getOrCreateScopArrayInfo(Allocation, EleTy, Sizes, MemoryKind::Array); - Id = isl_id_alloc(S.getIslCtx(), Var.name, nullptr); + Id = isl_id_alloc(S.getIslCtx().get(), Var.name, nullptr); IDToValue[Id] = Allocation; LocalArrays.push_back(Allocation); KernelIds.push_back(Id); @@ -2684,9 +2684,9 @@ public: /// @returns Retun a map from collected ids to 'zero' ast expressions. __isl_give isl_id_to_ast_expr *getNames() { auto *Names = isl_id_to_ast_expr_alloc( - S->getIslCtx(), + S->getIslCtx().get(), S->getNumParams() + std::distance(S->array_begin(), S->array_end())); - auto *Zero = isl_ast_expr_from_val(isl_val_zero(S->getIslCtx())); + auto *Zero = isl_ast_expr_from_val(isl_val_zero(S->getIslCtx().get())); for (const SCEV *P : S->parameters()) { isl_id *Id = S->getIdForParam(P).release(); @@ -2773,7 +2773,8 @@ public: gpu_stmt_access *Accesses = nullptr; for (MemoryAccess *Acc : Stmt) { - auto Access = isl_alloc_type(S->getIslCtx(), struct gpu_stmt_access); + auto Access = + isl_alloc_type(S->getIslCtx().get(), struct gpu_stmt_access); Access->read = Acc->isRead(); Access->write = Acc->isWrite(); Access->access = Acc->getAccessRelation().release(); @@ -2806,7 +2807,7 @@ public: /// /// @returns A linked-list of statements. gpu_stmt *getStatements() { - gpu_stmt *Stmts = isl_calloc_array(S->getIslCtx(), struct gpu_stmt, + gpu_stmt *Stmts = isl_calloc_array(S->getIslCtx().get(), struct gpu_stmt, std::distance(S->begin(), S->end())); int i = 0; @@ -2978,7 +2979,7 @@ public: assert(AlignSpace && "alignPwAffs did not initialise AlignSpace"); isl_pw_aff_list *BoundsList = - createPwAffList(S->getIslCtx(), std::move(AlignedBounds)); + createPwAffList(S->getIslCtx().get(), std::move(AlignedBounds)); isl_space *BoundsSpace = isl_set_get_space(PPCGArray.extent); BoundsSpace = isl_space_align_params(BoundsSpace, AlignSpace); @@ -3059,9 +3060,9 @@ public: if (!PPCGScop) return nullptr; - auto PPCGProg = isl_calloc_type(S->getIslCtx(), struct gpu_prog); + auto PPCGProg = isl_calloc_type(S->getIslCtx().get(), struct gpu_prog); - PPCGProg->ctx = S->getIslCtx(); + PPCGProg->ctx = S->getIslCtx().get(); PPCGProg->scop = PPCGScop; PPCGProg->context = isl_set_copy(PPCGScop->context); PPCGProg->read = isl_union_map_copy(PPCGScop->reads); @@ -3090,7 +3091,7 @@ public: PPCGProg->n_array = ValidSAIs.size(); // std::distance(S->array_begin(), S->array_end()); - PPCGProg->array = isl_calloc_array(S->getIslCtx(), struct gpu_array_info, + PPCGProg->array = isl_calloc_array(S->getIslCtx().get(), struct gpu_array_info, PPCGProg->n_array); createArrays(PPCGProg, ValidSAIs); @@ -3155,9 +3156,9 @@ public: /// /// @param Kernel The kernel to print void printKernel(ppcg_kernel *Kernel) { - auto *P = isl_printer_to_str(S->getIslCtx()); + auto *P = isl_printer_to_str(S->getIslCtx().get()); P = isl_printer_set_output_format(P, ISL_FORMAT_C); - auto *Options = isl_ast_print_options_alloc(S->getIslCtx()); + auto *Options = isl_ast_print_options_alloc(S->getIslCtx().get()); P = isl_ast_node_print(Kernel->tree, P, Options); char *String = isl_printer_get_str(P); printf("%s\n", String); @@ -3170,13 +3171,13 @@ public: /// @param Tree An AST describing GPU code /// @param PPCGProg The PPCG program from which @Tree has been constructed. void printGPUTree(isl_ast_node *Tree, gpu_prog *PPCGProg) { - auto *P = isl_printer_to_str(S->getIslCtx()); + auto *P = isl_printer_to_str(S->getIslCtx().get()); P = isl_printer_set_output_format(P, ISL_FORMAT_C); PrintGPUUserData Data; Data.PPCGProg = PPCGProg; - auto *Options = isl_ast_print_options_alloc(S->getIslCtx()); + auto *Options = isl_ast_print_options_alloc(S->getIslCtx().get()); Options = isl_ast_print_options_set_print_user(Options, printHostUser, &Data); P = isl_ast_node_print(Tree, P, Options); @@ -3205,9 +3206,9 @@ public: // strategy directly from this pass. gpu_gen *generateGPU(ppcg_scop *PPCGScop, gpu_prog *PPCGProg) { - auto PPCGGen = isl_calloc_type(S->getIslCtx(), struct gpu_gen); + auto PPCGGen = isl_calloc_type(S->getIslCtx().get(), struct gpu_gen); - PPCGGen->ctx = S->getIslCtx(); + PPCGGen->ctx = S->getIslCtx().get(); PPCGGen->options = PPCGScop->options; PPCGGen->print = nullptr; PPCGGen->print_user = nullptr; @@ -3243,7 +3244,7 @@ public: } if (DumpSchedule) { - isl_printer *P = isl_printer_to_str(S->getIslCtx()); + isl_printer *P = isl_printer_to_str(S->getIslCtx().get()); P = isl_printer_set_yaml_style(P, ISL_YAML_STYLE_BLOCK); P = isl_printer_print_str(P, "Schedule\n"); P = isl_printer_print_str(P, "========\n"); @@ -3355,7 +3356,7 @@ public: } } - isl_val *InstVal = isl_val_int_from_si(S->getIslCtx(), InstCount); + isl_val *InstVal = isl_val_int_from_si(S->getIslCtx().get(), InstCount); auto *InstExpr = isl_ast_expr_from_val(InstVal); return isl_ast_expr_mul(InstExpr, Iterations); } @@ -3371,7 +3372,7 @@ public: getNumberOfIterations(Scop &S, __isl_keep isl_ast_build *Build) { isl_ast_expr *Instructions; - isl_val *Zero = isl_val_int_from_si(S.getIslCtx(), 0); + isl_val *Zero = isl_val_int_from_si(S.getIslCtx().get(), 0); Instructions = isl_ast_expr_from_val(Zero); for (ScopStmt &Stmt : S) { @@ -3391,7 +3392,7 @@ public: __isl_give isl_ast_expr * createSufficientComputeCheck(Scop &S, __isl_keep isl_ast_build *Build) { auto Iterations = getNumberOfIterations(S, Build); - auto *MinComputeVal = isl_val_int_from_si(S.getIslCtx(), MinCompute); + auto *MinComputeVal = isl_val_int_from_si(S.getIslCtx().get(), MinCompute); auto *MinComputeExpr = isl_ast_expr_from_val(MinComputeVal); return isl_ast_expr_ge(Iterations, MinComputeExpr); } @@ -3477,7 +3478,7 @@ public: auto SplitBlock = StartBlock->getSinglePredecessor(); Builder.SetInsertPoint(SplitBlock->getTerminator()); - isl_ast_build *Build = isl_ast_build_alloc(S->getIslCtx()); + isl_ast_build *Build = isl_ast_build_alloc(S->getIslCtx().get()); isl_ast_expr *Condition = IslAst::buildRunCondition(*S, Build); isl_ast_expr *SufficientCompute = createSufficientComputeCheck(*S, Build); Condition = isl_ast_expr_and(Condition, SufficientCompute); |

