summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2016-09-01 23:31:25 +0000
committerDehao Chen <dehao@google.com>2016-09-01 23:31:25 +0000
commite81d50b3b9fce8abb9dff7526ec92e15666a692f (patch)
treef34552f465026e78012e1b95ceab548d9b4f5e08 /llvm/lib/Transforms
parente091f8e814fec8bca64af7fa245edd35c6d15a68 (diff)
downloadbcm5719-llvm-e81d50b3b9fce8abb9dff7526ec92e15666a692f.tar.gz
bcm5719-llvm-e81d50b3b9fce8abb9dff7526ec92e15666a692f.zip
Refactor LICM to expose canSinkOrHoistInst to LoopSink pass.
Summary: LoopSink pass shares the same canSinkOrHoistInst functionality with LICM pass. This patch exposes this function in preparation of https://reviews.llvm.org/D22778 Reviewers: chandlerc, davidxl, danielcdh Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24171 llvm-svn: 280429
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 99d7e2e1f0b..c8af3095443 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -100,10 +100,6 @@ static Instruction *
CloneInstructionInExitBlock(Instruction &I, BasicBlock &ExitBlock, PHINode &PN,
const LoopInfo *LI,
const LoopSafetyInfo *SafetyInfo);
-static bool canSinkOrHoistInst(Instruction &I, AliasAnalysis *AA,
- DominatorTree *DT,
- Loop *CurLoop, AliasSetTracker *CurAST,
- LoopSafetyInfo *SafetyInfo);
namespace {
struct LoopInvariantCodeMotion {
@@ -439,9 +435,9 @@ void llvm::computeLoopSafetyInfo(LoopSafetyInfo *SafetyInfo, Loop *CurLoop) {
/// canSinkOrHoistInst - Return true if the hoister and sinker can handle this
/// instruction.
///
-bool canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
- Loop *CurLoop, AliasSetTracker *CurAST,
- LoopSafetyInfo *SafetyInfo) {
+bool llvm::canSinkOrHoistInst(Instruction &I, AAResults *AA, DominatorTree *DT,
+ Loop *CurLoop, AliasSetTracker *CurAST,
+ LoopSafetyInfo *SafetyInfo) {
if (!isa<LoadInst>(I) && !isa<CallInst>(I) &&
!isa<BinaryOperator>(I) && !isa<CastInst>(I) && !isa<SelectInst>(I) &&
!isa<GetElementPtrInst>(I) && !isa<CmpInst>(I) &&
OpenPOWER on IntegriCloud