summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorJinsong Ji <jji@us.ibm.com>2019-07-09 17:53:09 +0000
committerJinsong Ji <jji@us.ibm.com>2019-07-09 17:53:09 +0000
commit06fef0b359b1b932b4d09d630175d9243394d062 (patch)
treee7047f5663c6a9e32127d28725d0112796b362a7 /llvm/lib/Analysis
parent65f964c23eb13ee592f4adfe7a9628b4ee1de286 (diff)
downloadbcm5719-llvm-06fef0b359b1b932b4d09d630175d9243394d062.tar.gz
bcm5719-llvm-06fef0b359b1b932b4d09d630175d9243394d062.zip
Revert "[HardwareLoops] NFC - move hardware loop checking code to isHardwareLoopProfitable()"
This reverts commit d95557306585404893d610784edb3e32f1bfce18. llvm-svn: 365520
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/TargetTransformInfo.cpp33
1 files changed, 1 insertions, 32 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 23aa4d3a311..50c5ae9c19f 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -20,9 +20,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/LoopIterator.h"
-#include "llvm/Transforms/Utils.h"
-#include "llvm/Transforms/Utils/LoopUtils.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include <utility>
using namespace llvm;
@@ -58,8 +55,7 @@ bool HardwareLoopInfo::canAnalyze(LoopInfo &LI) {
bool HardwareLoopInfo::isHardwareLoopCandidate(ScalarEvolution &SE,
LoopInfo &LI, DominatorTree &DT,
bool ForceNestedLoop,
- bool ForceHardwareLoopPHI,
- bool ForceGuardLoopEntry) {
+ bool ForceHardwareLoopPHI) {
SmallVector<BasicBlock *, 4> ExitingBlocks;
L->getExitingBlocks(ExitingBlocks);
@@ -138,33 +134,6 @@ bool HardwareLoopInfo::isHardwareLoopCandidate(ScalarEvolution &SE,
if (!ExitBlock)
return false;
-
- BasicBlock *Preheader = L->getLoopPreheader();
-
- // If we don't have a preheader, then insert one.
- if (!Preheader)
- Preheader = InsertPreheaderForLoop(L, &DT, &LI, nullptr, true);
- if (!Preheader)
- return false;
-
- // Make sure we have a valid Loop Count
- if (!ExitCount->getType()->isPointerTy() && ExitCount->getType() != CountType)
- ExitCount = SE.getZeroExtendExpr(ExitCount, CountType);
-
- ExitCount = SE.getAddExpr(ExitCount, SE.getOne(CountType));
-
- BasicBlock *BB = L->getLoopPreheader();
-
- if (ForceGuardLoopEntry && BB->getSinglePredecessor() &&
- cast<BranchInst>(BB->getTerminator())->isUnconditional())
- BB = BB->getSinglePredecessor();
-
- if (!isSafeToExpandAt(ExitCount, BB->getTerminator(), SE)) {
- LLVM_DEBUG(dbgs() << "Not a Hardware Loop: unsafe to expand ExitCount "
- << *ExitCount << "\n");
- return false;
- }
-
return true;
}
OpenPOWER on IntegriCloud