Index: include/polly/CodeGen/BlockGenerators.h =================================================================== --- include/polly/CodeGen/BlockGenerators.h +++ include/polly/CodeGen/BlockGenerators.h @@ -147,9 +147,9 @@ /// This will initialize and finalize the scalar variables we demoted during /// the code generation. /// - /// @see createScalarInitialization(Region &, ValueMapT &) + /// @see createScalarInitialization(Region &) /// @see createScalarFinalization(Region &) - void finalizeSCoP(Scop &S, ValueMapT &VMap); + void finalizeSCoP(Scop &S); /// @brief An empty destructor virtual ~BlockGenerator(){}; @@ -389,7 +389,7 @@ /// the SCoP we need to initialize the memory cell we demoted the PHI into /// with the value corresponding to that predecessor. As a SCoP is a /// __single__ entry region there is at most one such predecessor. - void createScalarInitialization(Region &R, ValueMapT &VMap); + void createScalarInitialization(Region &R); /// @brief Promote the values of demoted scalars after the SCoP. /// Index: include/polly/CodeGen/IslNodeBuilder.h =================================================================== --- include/polly/CodeGen/IslNodeBuilder.h +++ include/polly/CodeGen/IslNodeBuilder.h @@ -44,7 +44,7 @@ /// @brief Finalize code generation for the SCoP @p S. /// /// @see BlockGenerator::finalizeSCoP(Scop &S) - void finalizeSCoP(Scop &S) { BlockGen.finalizeSCoP(S, ValueMap); } + void finalizeSCoP(Scop &S) { BlockGen.finalizeSCoP(S); } IslExprBuilder &getExprBuilder() { return ExprBuilder; } Index: lib/CodeGen/BlockGenerators.cpp =================================================================== --- lib/CodeGen/BlockGenerators.cpp +++ lib/CodeGen/BlockGenerators.cpp @@ -501,8 +501,7 @@ } } -void BlockGenerator::createScalarInitialization(Region &R, - ValueMapT &GlobalMap) { +void BlockGenerator::createScalarInitialization(Region &R) { // The split block __just before__ the region and optimized region. BasicBlock *SplitBB = R.getEnteringBlock(); BranchInst *SplitBBTerm = cast(SplitBB->getTerminator()); @@ -517,7 +516,6 @@ // value prior to entering the optimized region. Builder.SetInsertPoint(StartBB->getTerminator()); - ScalarAllocaMapTy EmptyMap; for (const auto &PHIOpMapping : PHIOpMap) { const PHINode *PHI = cast(PHIOpMapping.getFirst()); @@ -528,8 +526,6 @@ continue; Value *ScalarValue = PHI->getIncomingValue(idx); - ScalarValue = - getNewScalarValue(ScalarValue, R, EmptyMap, GlobalMap, GlobalMap); // If the split block is the predecessor initialize the PHI operator alloca. Builder.CreateStore(ScalarValue, PHIOpMapping.getSecond()); @@ -580,8 +576,8 @@ } } -void BlockGenerator::finalizeSCoP(Scop &S, ValueMapT &GlobalMap) { - createScalarInitialization(S.getRegion(), GlobalMap); +void BlockGenerator::finalizeSCoP(Scop &S) { + createScalarInitialization(S.getRegion()); createScalarFinalization(S.getRegion()); }