diff options
author | Tobias Grosser <tobias@grosser.es> | 2014-03-04 14:58:49 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2014-03-04 14:58:49 +0000 |
commit | 5103ba7c919dc3d7f0e93c3ae126a947a363dd33 (patch) | |
tree | a6cc67e053b9cd949a8b8935ed3954209335674e /polly/lib/CodeGen | |
parent | 30076b024455c0e6a34d4edc007d8fa48903fbbe (diff) | |
download | bcm5719-llvm-5103ba7c919dc3d7f0e93c3ae126a947a363dd33.tar.gz bcm5719-llvm-5103ba7c919dc3d7f0e93c3ae126a947a363dd33.zip |
Introduce PollyIRBuilder
PollyIRBuilder is currently just a typedef to IRBuilder<>. Consequently, this
change should not affect behavior. In subsequent patches we will extend its
functionality to emit loop.parallel metadata.
llvm-svn: 202853
Diffstat (limited to 'polly/lib/CodeGen')
-rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 8 | ||||
-rw-r--r-- | polly/lib/CodeGen/CodeGeneration.cpp | 14 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslCodeGeneration.cpp | 16 | ||||
-rw-r--r-- | polly/lib/CodeGen/LoopGenerators.cpp | 2 | ||||
-rw-r--r-- | polly/lib/CodeGen/PTXGenerator.cpp | 2 | ||||
-rw-r--r-- | polly/lib/CodeGen/Utils.cpp | 4 |
6 files changed, 23 insertions, 23 deletions
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index a5d1f0f0b5d..1ea5608a561 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -65,7 +65,7 @@ bool polly::canSynthesize(const Instruction *I, const llvm::LoopInfo *LI, namespace { class IslGenerator { public: - IslGenerator(IRBuilder<> &Builder, std::vector<Value *> &IVS) + IslGenerator(PollyIRBuilder &Builder, std::vector<Value *> &IVS) : Builder(Builder), IVS(IVS) {} Value *generateIslVal(__isl_take isl_val *Val); Value *generateIslAff(__isl_take isl_aff *Aff); @@ -77,7 +77,7 @@ private: class IslGenerator *Generator; } IslGenInfo; - IRBuilder<> &Builder; + PollyIRBuilder &Builder; std::vector<Value *> &IVS; static int mergeIslAffValues(__isl_take isl_set *Set, __isl_take isl_aff *Aff, void *User); @@ -155,7 +155,7 @@ Value *IslGenerator::generateIslPwAff(__isl_take isl_pw_aff *PwAff) { return User.Result; } -BlockGenerator::BlockGenerator(IRBuilder<> &B, ScopStmt &Stmt, Pass *P) +BlockGenerator::BlockGenerator(PollyIRBuilder &B, ScopStmt &Stmt, Pass *P) : Builder(B), Statement(Stmt), P(P), SE(P->getAnalysis<ScalarEvolution>()) { } @@ -395,7 +395,7 @@ void BlockGenerator::copyBB(ValueMapT &GlobalMap, LoopToScevMapT <S) { copyInstruction(II, BBMap, GlobalMap, LTS); } -VectorBlockGenerator::VectorBlockGenerator(IRBuilder<> &B, +VectorBlockGenerator::VectorBlockGenerator(PollyIRBuilder &B, VectorValueMapT &GlobalMaps, std::vector<LoopToScevMapT> &VLTS, ScopStmt &Stmt, diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index 36c39cd070e..38a4d639164 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -82,7 +82,7 @@ typedef DenseMap<const char *, Value *> CharMapT; /// Class to generate LLVM-IR that calculates the value of a clast_expr. class ClastExpCodeGen { - IRBuilder<> &Builder; + PollyIRBuilder &Builder; const CharMapT &IVS; Value *codegen(const clast_name *e, Type *Ty); @@ -98,7 +98,7 @@ public: // @param IVMAP A Map that translates strings describing the induction // variables to the Values* that represent these variables // on the LLVM side. - ClastExpCodeGen(IRBuilder<> &B, CharMapT &IVMap); + ClastExpCodeGen(PollyIRBuilder &B, CharMapT &IVMap); // Generates code to calculate a given clast expression. // @@ -216,7 +216,7 @@ Value *ClastExpCodeGen::codegen(const clast_reduction *r, Type *Ty) { return old; } -ClastExpCodeGen::ClastExpCodeGen(IRBuilder<> &B, CharMapT &IVMap) +ClastExpCodeGen::ClastExpCodeGen(PollyIRBuilder &B, CharMapT &IVMap) : Builder(B), IVS(IVMap) {} Value *ClastExpCodeGen::codegen(const clast_expr *e, Type *Ty) { @@ -244,7 +244,7 @@ private: Pass *P; // The Builder specifies the current location to code generate at. - IRBuilder<> &Builder; + PollyIRBuilder &Builder; // Map the Values from the old code to their counterparts in the new code. ValueMapT ValueMap; @@ -375,7 +375,7 @@ private: public: void codegen(const clast_root *r); - ClastStmtCodeGen(Scop *scop, IRBuilder<> &B, Pass *P); + ClastStmtCodeGen(Scop *scop, PollyIRBuilder &B, Pass *P); }; } @@ -1006,7 +1006,7 @@ void ClastStmtCodeGen::codegen(const clast_root *r) { codegen(stmt->next); } -ClastStmtCodeGen::ClastStmtCodeGen(Scop *scop, IRBuilder<> &B, Pass *P) +ClastStmtCodeGen::ClastStmtCodeGen(Scop *scop, PollyIRBuilder &B, Pass *P) : S(scop), P(P), Builder(B), ExpGen(Builder, ClastVars) {} namespace { @@ -1028,7 +1028,7 @@ public: BasicBlock *StartBlock = executeScopConditionally(S, this); - IRBuilder<> Builder(StartBlock->begin()); + PollyIRBuilder Builder(StartBlock->begin()); ClastStmtCodeGen CodeGen(&S, Builder, this); CloogInfo &C = getAnalysis<CloogInfo>(); diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp index ed17050e002..d68a575f50d 100644 --- a/polly/lib/CodeGen/IslCodeGeneration.cpp +++ b/polly/lib/CodeGen/IslCodeGeneration.cpp @@ -58,7 +58,7 @@ using namespace llvm; /// run time. class RuntimeDebugBuilder { public: - RuntimeDebugBuilder(IRBuilder<> &Builder) : Builder(Builder) {} + RuntimeDebugBuilder(PollyIRBuilder &Builder) : Builder(Builder) {} /// @brief Print a string to stdout. /// @@ -71,7 +71,7 @@ public: void createIntPrinter(Value *V); private: - IRBuilder<> &Builder; + PollyIRBuilder &Builder; /// @brief Add a call to the fflush function with no file pointer given. /// @@ -138,8 +138,8 @@ void RuntimeDebugBuilder::createIntPrinter(Value *V) { /// @brief Calculate the Value of a certain isl_ast_expr class IslExprBuilder { public: - IslExprBuilder(IRBuilder<> &Builder, std::map<isl_id *, Value *> &IDToValue, - Pass *P) + IslExprBuilder(PollyIRBuilder &Builder, + std::map<isl_id *, Value *> &IDToValue, Pass *P) : Builder(Builder), IDToValue(IDToValue) {} Value *create(__isl_take isl_ast_expr *Expr); @@ -147,7 +147,7 @@ public: IntegerType *getType(__isl_keep isl_ast_expr *Expr); private: - IRBuilder<> &Builder; + PollyIRBuilder &Builder; std::map<isl_id *, Value *> &IDToValue; Value *createOp(__isl_take isl_ast_expr *Expr); @@ -539,7 +539,7 @@ Value *IslExprBuilder::create(__isl_take isl_ast_expr *Expr) { class IslNodeBuilder { public: - IslNodeBuilder(IRBuilder<> &Builder, Pass *P) + IslNodeBuilder(PollyIRBuilder &Builder, Pass *P) : Builder(Builder), ExprBuilder(Builder, IDToValue, P), P(P) {} void addParameters(__isl_take isl_set *Context); @@ -547,7 +547,7 @@ public: IslExprBuilder &getExprBuilder() { return ExprBuilder; } private: - IRBuilder<> &Builder; + PollyIRBuilder &Builder; IslExprBuilder ExprBuilder; Pass *P; @@ -1032,7 +1032,7 @@ public: BasicBlock *StartBlock = executeScopConditionally(S, this); isl_ast_node *Ast = AstInfo.getAst(); - IRBuilder<> Builder(StartBlock->begin()); + PollyIRBuilder Builder(StartBlock->begin()); IslNodeBuilder NodeBuilder(Builder, this); diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp index c1aa9f36fd6..3f9e1b0f535 100644 --- a/polly/lib/CodeGen/LoopGenerators.cpp +++ b/polly/lib/CodeGen/LoopGenerators.cpp @@ -47,7 +47,7 @@ using namespace polly; // TODO: We currently always create the GuardBB. If we can prove the loop is // always executed at least once, we can get rid of this branch. Value *polly::createLoop(Value *LB, Value *UB, Value *Stride, - IRBuilder<> &Builder, Pass *P, BasicBlock *&ExitBB, + PollyIRBuilder &Builder, Pass *P, BasicBlock *&ExitBB, ICmpInst::Predicate Predicate) { DominatorTree &DT = P->getAnalysis<DominatorTreeWrapperPass>().getDomTree(); diff --git a/polly/lib/CodeGen/PTXGenerator.cpp b/polly/lib/CodeGen/PTXGenerator.cpp index 50b3cdf9ad4..fb48f1289a2 100644 --- a/polly/lib/CodeGen/PTXGenerator.cpp +++ b/polly/lib/CodeGen/PTXGenerator.cpp @@ -33,7 +33,7 @@ using namespace llvm; using namespace polly; -PTXGenerator::PTXGenerator(IRBuilder<> &Builder, Pass *P, +PTXGenerator::PTXGenerator(PollyIRBuilder &Builder, Pass *P, const std::string &Triple) : Builder(Builder), P(P), GPUTriple(Triple), GridWidth(1), GridHeight(1), BlockWidth(1), BlockHeight(1), OutputBytes(0) { diff --git a/polly/lib/CodeGen/Utils.cpp b/polly/lib/CodeGen/Utils.cpp index 93978f72f17..3f58852c529 100644 --- a/polly/lib/CodeGen/Utils.cpp +++ b/polly/lib/CodeGen/Utils.cpp @@ -12,9 +12,9 @@ //===----------------------------------------------------------------------===// #include "polly/CodeGen/Utils.h" +#include "polly/CodeGen/IRBuilder.h" #include "polly/ScopInfo.h" #include "llvm/Analysis/LoopInfo.h" -#include "llvm/IR/IRBuilder.h" #include "llvm/Support/Debug.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" @@ -23,7 +23,7 @@ using namespace llvm; BasicBlock *polly::executeScopConditionally(Scop &S, Pass *PassInfo) { BasicBlock *StartBlock, *SplitBlock, *NewBlock; Region &R = S.getRegion(); - IRBuilder<> Builder(R.getEntry()); + PollyIRBuilder Builder(R.getEntry()); DominatorTree &DT = PassInfo->getAnalysis<DominatorTreeWrapperPass>().getDomTree(); RegionInfo &RI = PassInfo->getAnalysis<RegionInfo>(); |