From 305d3164f289625ad0d6c06af03abb57c0a99393 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Mon, 7 Aug 2017 00:10:11 +0000 Subject: [PATCH] [ScopInfo] Make Scop::canAlwaysBeHoisted a member function llvm-svn: 310236 --- polly/include/polly/ScopInfo.h | 5 +++++ polly/lib/Analysis/ScopInfo.cpp | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 7bdf6d3..f679835 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -2123,6 +2123,11 @@ private: /// have been hoisted as loop invariant. void canonicalizeDynamicBasePtrs(); + /// Check if @p MA can always be hoisted without execution context. + bool canAlwaysBeHoisted(MemoryAccess *MA, bool StmtInvalidCtxIsEmpty, + bool MAInvalidCtxIsEmpty, + bool NonHoistableCtxIsEmpty); + /// Add invariant loads listed in @p InvMAs with the domain of @p Stmt. void addInvariantLoads(ScopStmt &Stmt, InvariantAccessesTy &InvMAs); diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 12248e1..17c4453 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3836,10 +3836,9 @@ InvariantEquivClassTy *Scop::lookupInvariantEquivClass(Value *Val) { return nullptr; } -/// Check if @p MA can always be hoisted without execution context. -static bool canAlwaysBeHoisted(MemoryAccess *MA, bool StmtInvalidCtxIsEmpty, - bool MAInvalidCtxIsEmpty, - bool NonHoistableCtxIsEmpty) { +bool Scop::canAlwaysBeHoisted(MemoryAccess *MA, bool StmtInvalidCtxIsEmpty, + bool MAInvalidCtxIsEmpty, + bool NonHoistableCtxIsEmpty) { LoadInst *LInst = cast(MA->getAccessInstruction()); const DataLayout &DL = LInst->getParent()->getModule()->getDataLayout(); // TODO: We can provide more information for better but more expensive -- 2.7.4