diff options
-rw-r--r-- | polly/include/polly/Support/ScopHelper.h | 6 | ||||
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 5 | ||||
-rw-r--r-- | polly/lib/CodeGen/BlockGenerators.cpp | 2 | ||||
-rw-r--r-- | polly/lib/CodeGen/IslNodeBuilder.cpp | 6 | ||||
-rw-r--r-- | polly/lib/Support/ScopHelper.cpp | 7 |
5 files changed, 13 insertions, 13 deletions
diff --git a/polly/include/polly/Support/ScopHelper.h b/polly/include/polly/Support/ScopHelper.h index ea22a849ef6..1f73de88ed6 100644 --- a/polly/include/polly/Support/ScopHelper.h +++ b/polly/include/polly/Support/ScopHelper.h @@ -395,15 +395,15 @@ bool isIgnoredIntrinsic(const llvm::Value *V); /// ensure that their operands are available during code generation. /// /// @param V The value to check. +/// @param S The current SCoP. /// @param LI The LoopInfo analysis. /// @param SE The scalar evolution database. -/// @param R The region out of which SSA names are parameters. /// @param Scope Location where the value would by synthesized. /// @return If the instruction I can be regenerated from its /// scalar evolution representation, return true, /// otherwise return false. -bool canSynthesize(const llvm::Value *V, const llvm::LoopInfo *LI, - llvm::ScalarEvolution *SE, const llvm::Region *R, +bool canSynthesize(const llvm::Value *V, const Scop &S, + const llvm::LoopInfo *LI, llvm::ScalarEvolution *SE, llvm::Loop *Scope); /// @brief Return the block in which a value is used. diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 7df5e685c7b..44c282e3339 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -4255,7 +4255,7 @@ void ScopInfo::buildPHIAccesses(PHINode *PHI, Region *NonAffineSubRegion, // the region. If it is not it can only be in the exit block of the region. // In this case we model the operands but not the PHI itself. auto *Scope = LI->getLoopFor(PHI->getParent()); - if (!IsExitBlock && canSynthesize(PHI, LI, SE, &scop->getRegion(), Scope)) + if (!IsExitBlock && canSynthesize(PHI, *scop, LI, SE, Scope)) return; // PHI nodes are modeled as if they had been demoted prior to the SCoP @@ -4738,9 +4738,8 @@ void ScopInfo::ensureValueRead(Value *V, BasicBlock *UserBB) { // If the instruction can be synthesized and the user is in the region we do // not need to add a value dependences. - Region &ScopRegion = scop->getRegion(); auto *Scope = LI->getLoopFor(UserBB); - if (canSynthesize(V, LI, SE, &ScopRegion, Scope)) + if (canSynthesize(V, *scop, LI, SE, Scope)) return; // Do not build scalar dependences for required invariant loads as we will diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp index 7b07f42c7a1..93a2a464c77 100644 --- a/polly/lib/CodeGen/BlockGenerators.cpp +++ b/polly/lib/CodeGen/BlockGenerators.cpp @@ -237,7 +237,7 @@ void BlockGenerator::generateScalarStore(ScopStmt &Stmt, StoreInst *Store, bool BlockGenerator::canSyntheziseInStmt(ScopStmt &Stmt, Instruction *Inst) { Loop *L = getLoopForStmt(Stmt); return (Stmt.isBlockStmt() || !Stmt.getRegion()->contains(L)) && - canSynthesize(Inst, &LI, &SE, &Stmt.getParent()->getRegion(), L); + canSynthesize(Inst, *Stmt.getParent(), &LI, &SE, L); } void BlockGenerator::copyInstruction(ScopStmt &Stmt, Instruction *Inst, diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp index 47722e33c54..8ef6476b344 100644 --- a/polly/lib/CodeGen/IslNodeBuilder.cpp +++ b/polly/lib/CodeGen/IslNodeBuilder.cpp @@ -180,7 +180,7 @@ int IslNodeBuilder::getNumberOfIterations(__isl_keep isl_ast_node *For) { struct SubtreeReferences { LoopInfo &LI; ScalarEvolution &SE; - Region &R; + Scop &S; ValueMapT &GlobalMap; SetVector<Value *> &Values; SetVector<const SCEV *> &SCEVs; @@ -193,7 +193,7 @@ static int findReferencesInBlock(struct SubtreeReferences &References, for (const Instruction &Inst : *BB) for (Value *SrcVal : Inst.operands()) { auto *Scope = References.LI.getLoopFor(BB); - if (canSynthesize(SrcVal, &References.LI, &References.SE, &References.R, + if (canSynthesize(SrcVal, References.S, &References.LI, &References.SE, Scope)) { References.SCEVs.insert(References.SE.getSCEVAtScope(SrcVal, Scope)); continue; @@ -292,7 +292,7 @@ void IslNodeBuilder::getReferencesInSubtree(__isl_keep isl_ast_node *For, SetVector<const SCEV *> SCEVs; struct SubtreeReferences References = { - LI, SE, S.getRegion(), ValueMap, Values, SCEVs, getBlockGenerator()}; + LI, SE, S, ValueMap, Values, SCEVs, getBlockGenerator()}; for (const auto &I : IDToValue) Values.insert(I.second); diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp index 075d91a2400..29511dda0a7 100644 --- a/polly/lib/Support/ScopHelper.cpp +++ b/polly/lib/Support/ScopHelper.cpp @@ -441,14 +441,15 @@ bool polly::isIgnoredIntrinsic(const Value *V) { return false; } -bool polly::canSynthesize(const Value *V, const llvm::LoopInfo *LI, - ScalarEvolution *SE, const Region *R, Loop *Scope) { +bool polly::canSynthesize(const Value *V, const Scop &S, + const llvm::LoopInfo *LI, ScalarEvolution *SE, + Loop *Scope) { if (!V || !SE->isSCEVable(V->getType())) return false; if (const SCEV *Scev = SE->getSCEVAtScope(const_cast<Value *>(V), Scope)) if (!isa<SCEVCouldNotCompute>(Scev)) - if (!hasScalarDepsInsideRegion(Scev, R, Scope, false)) + if (!hasScalarDepsInsideRegion(Scev, &S.getRegion(), Scope, false)) return true; return false; |