[polly] r271521 - [NFC] Rename ScopInfo to ScopBuilder
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 2 07:36:35 PDT 2016
Author: jdoerfert
Date: Thu Jun 2 09:36:34 2016
New Revision: 271521
URL: http://llvm.org/viewvc/llvm-project?rev=271521&view=rev
Log:
[NFC] Rename ScopInfo to ScopBuilder
Contributed-by: Utpal Bora <cs14mtech11017 at iith.ac.in>
Reviewed-by: Michael Kruse <meinersbur at googlemail.com>
Johannes Doerfert <doerfert at cs.uni-saarland.de>
Differential Revision: http://reviews.llvm.org/D20831
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=271521&r1=271520&r2=271521&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Thu Jun 2 09:36:34 2016
@@ -64,7 +64,7 @@ namespace polly {
class MemoryAccess;
class Scop;
class ScopStmt;
-class ScopInfo;
+class ScopBuilder;
//===---------------------------------------------------------------------===//
@@ -482,7 +482,7 @@ private:
/// sum[i+j] = sum[i] + 3;
///
/// Here not all iterations access the same memory location, but iterations
- /// for which j = 0 holds do. After lifting the equality check in ScopInfo,
+ /// for which j = 0 holds do. After lifting the equality check in ScopBuilder,
/// subsequent transformations do not only need check if a statement is
/// reduction like, but they also need to verify that that the reduction
/// property is only exploited for statement instances that load from and
@@ -1503,7 +1503,7 @@ private:
/// @brief List of invariant accesses.
InvariantEquivClassesTy InvariantEquivClasses;
- /// @brief Scop constructor; invoked from ScopInfo::buildScop.
+ /// @brief Scop constructor; invoked from ScopBuilder::buildScop.
Scop(Region &R, ScalarEvolution &SE, LoopInfo &LI,
ScopDetection::DetectionContext &DC);
@@ -1513,7 +1513,7 @@ private:
}
//@}
- /// @brief Initialize this ScopInfo .
+ /// @brief Initialize this ScopBuilder.
void init(AliasAnalysis &AA, AssumptionCache &AC, DominatorTree &DT,
LoopInfo &LI);
@@ -1814,7 +1814,7 @@ private:
void printAliasAssumptions(raw_ostream &OS) const;
//@}
- friend class ScopInfo;
+ friend class ScopBuilder;
public:
~Scop();
@@ -2247,10 +2247,10 @@ static inline raw_ostream &operator<<(ra
}
/// @brief Build the Polly IR (Scop and ScopStmt) on a Region.
-class ScopInfo {
+class ScopBuilder {
//===-------------------------------------------------------------------===//
- ScopInfo(const ScopInfo &) = delete;
- const ScopInfo &operator=(const ScopInfo &) = delete;
+ ScopBuilder(const ScopBuilder &) = delete;
+ const ScopBuilder &operator=(const ScopBuilder &) = delete;
/// @brief The AliasAnalysis to build AliasSetTracker.
AliasAnalysis &AA;
@@ -2468,10 +2468,10 @@ class ScopInfo {
void addPHIReadAccess(PHINode *PHI);
public:
- explicit ScopInfo(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
- const DataLayout &DL, DominatorTree &DT, LoopInfo &LI,
- ScopDetection &SD, ScalarEvolution &SE);
- ~ScopInfo() {}
+ explicit ScopBuilder(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
+ const DataLayout &DL, DominatorTree &DT, LoopInfo &LI,
+ ScopDetection &SD, ScalarEvolution &SE);
+ ~ScopBuilder() {}
/// @brief Try to build the Polly IR of static control part on the current
/// SESE-Region.
@@ -2486,8 +2486,8 @@ public:
/// @brief The legacy pass manager's analysis pass to compute scop information
/// for a region.
class ScopInfoRegionPass : public RegionPass {
- /// @brief The ScopInfo pointer which is used to construct a Scop.
- std::unique_ptr<ScopInfo> SI;
+ /// @brief The ScopBuilder pointer which is used to construct a Scop.
+ std::unique_ptr<ScopBuilder> SI;
public:
static char ID; // Pass identification, replacement for typeid
@@ -2495,8 +2495,8 @@ public:
ScopInfoRegionPass() : RegionPass(ID) {}
~ScopInfoRegionPass() {}
- /// @brief Build ScopInfo object, which constructs Polly IR of static control
- /// part for the current SESE-Region.
+ /// @brief Build ScopBuilder object, which constructs Polly IR of static
+ /// control part for the current SESE-Region.
///
/// @return Return Scop for the current Region.
Scop *getScop() {
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=271521&r1=271520&r2=271521&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Jun 2 09:36:34 2016
@@ -4239,8 +4239,8 @@ int Scop::getRelativeLoopDepth(const Loo
return L->getLoopDepth() - OuterLoop->getLoopDepth();
}
-void ScopInfo::buildPHIAccesses(PHINode *PHI, Region *NonAffineSubRegion,
- bool IsExitBlock) {
+void ScopBuilder::buildPHIAccesses(PHINode *PHI, Region *NonAffineSubRegion,
+ bool IsExitBlock) {
// PHI nodes that are in the exit block of the region, hence if IsExitBlock is
// true, are not modeled as ordinary PHI nodes as they are not part of the
@@ -4275,7 +4275,7 @@ void ScopInfo::buildPHIAccesses(PHINode
}
}
-void ScopInfo::buildScalarDependences(Instruction *Inst) {
+void ScopBuilder::buildScalarDependences(Instruction *Inst) {
assert(!isa<PHINode>(Inst));
// Pull-in required operands.
@@ -4283,7 +4283,7 @@ void ScopInfo::buildScalarDependences(In
ensureValueRead(Op.get(), Inst->getParent());
}
-void ScopInfo::buildEscapingDependences(Instruction *Inst) {
+void ScopBuilder::buildEscapingDependences(Instruction *Inst) {
// Check for uses of this instruction outside the scop. Because we do not
// iterate over such instructions and therefore did not "ensure" the existence
// of a write, we must determine such use here.
@@ -4310,7 +4310,7 @@ void ScopInfo::buildEscapingDependences(
}
}
-bool ScopInfo::buildAccessMultiDimFixed(MemAccInst Inst, Loop *L) {
+bool ScopBuilder::buildAccessMultiDimFixed(MemAccInst Inst, Loop *L) {
Value *Val = Inst.getValueOperand();
Type *ElementType = Val->getType();
Value *Address = Inst.getPointerOperand();
@@ -4377,7 +4377,7 @@ bool ScopInfo::buildAccessMultiDimFixed(
return true;
}
-bool ScopInfo::buildAccessMultiDimParam(MemAccInst Inst, Loop *L) {
+bool ScopBuilder::buildAccessMultiDimParam(MemAccInst Inst, Loop *L) {
if (!PollyDelinearize)
return false;
@@ -4419,7 +4419,7 @@ bool ScopInfo::buildAccessMultiDimParam(
return true;
}
-bool ScopInfo::buildAccessMemIntrinsic(MemAccInst Inst, Loop *L) {
+bool ScopBuilder::buildAccessMemIntrinsic(MemAccInst Inst, Loop *L) {
auto *MemIntr = dyn_cast_or_null<MemIntrinsic>(Inst);
if (MemIntr == nullptr)
@@ -4483,7 +4483,7 @@ bool ScopInfo::buildAccessMemIntrinsic(M
return true;
}
-bool ScopInfo::buildAccessCallInst(MemAccInst Inst, Loop *L) {
+bool ScopBuilder::buildAccessCallInst(MemAccInst Inst, Loop *L) {
auto *CI = dyn_cast_or_null<CallInst>(Inst);
if (CI == nullptr)
@@ -4526,7 +4526,7 @@ bool ScopInfo::buildAccessCallInst(MemAc
return true;
}
-void ScopInfo::buildAccessSingleDim(MemAccInst Inst, Loop *L) {
+void ScopBuilder::buildAccessSingleDim(MemAccInst Inst, Loop *L) {
Value *Address = Inst.getPointerOperand();
Value *Val = Inst.getValueOperand();
Type *ElementType = Val->getType();
@@ -4566,7 +4566,7 @@ void ScopInfo::buildAccessSingleDim(MemA
{AccessFunction}, {}, Val);
}
-void ScopInfo::buildMemoryAccess(MemAccInst Inst, Loop *L) {
+void ScopBuilder::buildMemoryAccess(MemAccInst Inst, Loop *L) {
if (buildAccessMemIntrinsic(Inst, L))
return;
@@ -4583,7 +4583,7 @@ void ScopInfo::buildMemoryAccess(MemAccI
buildAccessSingleDim(Inst, L);
}
-void ScopInfo::buildAccessFunctions(Region &SR) {
+void ScopBuilder::buildAccessFunctions(Region &SR) {
if (scop->isNonAffineSubRegion(&SR)) {
for (BasicBlock *BB : SR.blocks())
@@ -4598,7 +4598,7 @@ void ScopInfo::buildAccessFunctions(Regi
buildAccessFunctions(*I->getNodeAs<BasicBlock>());
}
-void ScopInfo::buildStmts(Region &SR) {
+void ScopBuilder::buildStmts(Region &SR) {
if (scop->isNonAffineSubRegion(&SR)) {
scop->addScopStmt(nullptr, &SR);
@@ -4612,8 +4612,9 @@ void ScopInfo::buildStmts(Region &SR) {
scop->addScopStmt(I->getNodeAs<BasicBlock>(), nullptr);
}
-void ScopInfo::buildAccessFunctions(BasicBlock &BB, Region *NonAffineSubRegion,
- bool IsExitBlock) {
+void ScopBuilder::buildAccessFunctions(BasicBlock &BB,
+ Region *NonAffineSubRegion,
+ bool IsExitBlock) {
// We do not build access functions for error blocks, as they may contain
// instructions we can not model.
if (isErrorBlock(BB, scop->getRegion(), LI, DT) && !IsExitBlock)
@@ -4648,13 +4649,11 @@ void ScopInfo::buildAccessFunctions(Basi
}
}
-MemoryAccess *ScopInfo::addMemoryAccess(BasicBlock *BB, Instruction *Inst,
- MemoryAccess::AccessType AccType,
- Value *BaseAddress, Type *ElementType,
- bool Affine, Value *AccessValue,
- ArrayRef<const SCEV *> Subscripts,
- ArrayRef<const SCEV *> Sizes,
- ScopArrayInfo::MemoryKind Kind) {
+MemoryAccess *ScopBuilder::addMemoryAccess(
+ BasicBlock *BB, Instruction *Inst, MemoryAccess::AccessType AccType,
+ Value *BaseAddress, Type *ElementType, bool Affine, Value *AccessValue,
+ ArrayRef<const SCEV *> Subscripts, ArrayRef<const SCEV *> Sizes,
+ ScopArrayInfo::MemoryKind Kind) {
ScopStmt *Stmt = scop->getStmtFor(BB);
// Do not create a memory access for anything not in the SCoP. It would be
@@ -4696,19 +4695,17 @@ MemoryAccess *ScopInfo::addMemoryAccess(
return &AccList.back();
}
-void ScopInfo::addArrayAccess(MemAccInst MemAccInst,
- MemoryAccess::AccessType AccType,
- Value *BaseAddress, Type *ElementType,
- bool IsAffine, ArrayRef<const SCEV *> Subscripts,
- ArrayRef<const SCEV *> Sizes,
- Value *AccessValue) {
+void ScopBuilder::addArrayAccess(
+ MemAccInst MemAccInst, MemoryAccess::AccessType AccType, Value *BaseAddress,
+ Type *ElementType, bool IsAffine, ArrayRef<const SCEV *> Subscripts,
+ ArrayRef<const SCEV *> Sizes, Value *AccessValue) {
ArrayBasePointers.insert(BaseAddress);
addMemoryAccess(MemAccInst->getParent(), MemAccInst, AccType, BaseAddress,
ElementType, IsAffine, AccessValue, Subscripts, Sizes,
ScopArrayInfo::MK_Array);
}
-void ScopInfo::ensureValueWrite(Instruction *Inst) {
+void ScopBuilder::ensureValueWrite(Instruction *Inst) {
ScopStmt *Stmt = scop->getStmtFor(Inst);
// Inst not defined within this SCoP.
@@ -4724,7 +4721,7 @@ void ScopInfo::ensureValueWrite(Instruct
ArrayRef<const SCEV *>(), ScopArrayInfo::MK_Value);
}
-void ScopInfo::ensureValueRead(Value *V, BasicBlock *UserBB) {
+void ScopBuilder::ensureValueRead(Value *V, BasicBlock *UserBB) {
// There cannot be an "access" for literal constants. BasicBlock references
// (jump destinations) also never change.
@@ -4779,8 +4776,8 @@ void ScopInfo::ensureValueRead(Value *V,
ensureValueWrite(ValueInst);
}
-void ScopInfo::ensurePHIWrite(PHINode *PHI, BasicBlock *IncomingBlock,
- Value *IncomingValue, bool IsExitBlock) {
+void ScopBuilder::ensurePHIWrite(PHINode *PHI, BasicBlock *IncomingBlock,
+ Value *IncomingValue, bool IsExitBlock) {
// As the incoming block might turn out to be an error statement ensure we
// will create an exit PHI SAI object. It is needed during code generation
// and would be created later anyway.
@@ -4815,13 +4812,13 @@ void ScopInfo::ensurePHIWrite(PHINode *P
Acc->addIncoming(IncomingBlock, IncomingValue);
}
-void ScopInfo::addPHIReadAccess(PHINode *PHI) {
+void ScopBuilder::addPHIReadAccess(PHINode *PHI) {
addMemoryAccess(PHI->getParent(), PHI, MemoryAccess::READ, PHI,
PHI->getType(), true, PHI, ArrayRef<const SCEV *>(),
ArrayRef<const SCEV *>(), ScopArrayInfo::MK_PHI);
}
-void ScopInfo::buildScop(Region &R, AssumptionCache &AC) {
+void ScopBuilder::buildScop(Region &R, AssumptionCache &AC) {
scop.reset(new Scop(R, SE, LI, *SD.getDetectionContext(&R)));
buildStmts(R);
@@ -4848,9 +4845,9 @@ void ScopInfo::buildScop(Region &R, Assu
scop->init(AA, AC, DT, LI);
}
-ScopInfo::ScopInfo(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
- const DataLayout &DL, DominatorTree &DT, LoopInfo &LI,
- ScopDetection &SD, ScalarEvolution &SE)
+ScopBuilder::ScopBuilder(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
+ const DataLayout &DL, DominatorTree &DT, LoopInfo &LI,
+ ScopDetection &SD, ScalarEvolution &SE)
: AA(AA), DL(DL), DT(DT), LI(LI), SD(SD), SE(SE) {
Function *F = R->getEntry()->getParent();
@@ -4877,7 +4874,7 @@ ScopInfo::ScopInfo(Region *R, Assumption
emitOptimizationRemarkAnalysis(F->getContext(), DEBUG_TYPE, *F, End, Msg);
}
-void ScopInfo::clear() { scop.reset(); }
+void ScopBuilder::clear() { scop.reset(); }
//===----------------------------------------------------------------------===//
void ScopInfoRegionPass::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -4905,7 +4902,7 @@ bool ScopInfoRegionPass::runOnRegion(Reg
auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(*F);
- SI.reset(new ScopInfo(R, AC, AA, DL, DT, LI, SD, SE));
+ SI.reset(new ScopBuilder(R, AC, AA, DL, DT, LI, SD, SE));
return false;
}
More information about the llvm-commits
mailing list