From 86083da0eccc2ad307d45e3427443743b54ac6d4 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Thu, 21 Jul 2016 13:15:55 +0000 Subject: [PATCH] IslNodeBuilder: expose addReferencesFromStmt [NFC] This will be used by Polly GPGPU to determine the values that need to be passed to GPU kernels. llvm-svn: 276269 --- polly/include/polly/CodeGen/IslNodeBuilder.h | 12 ++++++++++++ polly/lib/CodeGen/IslNodeBuilder.cpp | 12 +----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/polly/include/polly/CodeGen/IslNodeBuilder.h b/polly/include/polly/CodeGen/IslNodeBuilder.h index 5535603..e35233a 100644 --- a/polly/include/polly/CodeGen/IslNodeBuilder.h +++ b/polly/include/polly/CodeGen/IslNodeBuilder.h @@ -27,6 +27,18 @@ struct isl_ast_node; struct isl_ast_build; struct isl_union_map; +struct SubtreeReferences { + LoopInfo &LI; + ScalarEvolution &SE; + Scop &S; + ValueMapT &GlobalMap; + SetVector &Values; + SetVector &SCEVs; + BlockGenerator &BlockGen; +}; + +isl_stat addReferencesFromStmt(const ScopStmt *Stmt, void *UserPtr); + class IslNodeBuilder { public: IslNodeBuilder(PollyIRBuilder &Builder, ScopAnnotator &Annotator, Pass *P, diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 30fb75a..6b10258 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -177,16 +177,6 @@ int IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) { return NumberIterations + 1; } -struct SubtreeReferences { - LoopInfo &LI; - ScalarEvolution &SE; - Scop &S; - ValueMapT &GlobalMap; - SetVector &Values; - SetVector &SCEVs; - BlockGenerator &BlockGen; -}; - /// @brief Extract the values and SCEVs needed to generate code for a block. static int findReferencesInBlock(struct SubtreeReferences &References, const ScopStmt *Stmt, const BasicBlock *BB) { @@ -213,7 +203,7 @@ static int findReferencesInBlock(struct SubtreeReferences &References, /// @param Stmt The statement for which to extract the information. /// @param UserPtr A void pointer that can be casted to a SubtreeReferences /// structure. -static isl_stat addReferencesFromStmt(const ScopStmt *Stmt, void *UserPtr) { +isl_stat addReferencesFromStmt(const ScopStmt *Stmt, void *UserPtr) { auto &References = *static_cast(UserPtr); if (Stmt->isBlockStmt()) -- 2.7.4