summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/README.txt8
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp10
2 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/Target/README.txt b/llvm/lib/Target/README.txt
index 4e374e59d6d..f047d087cbf 100644
--- a/llvm/lib/Target/README.txt
+++ b/llvm/lib/Target/README.txt
@@ -414,14 +414,6 @@ this construct.
//===---------------------------------------------------------------------===//
-[LOOP RECOGNITION]
-
-viterbi speeds up *significantly* if the various "history" related copy loops
-are turned into memcpy calls at the source level. We need a "loops to memcpy"
-pass.
-
-//===---------------------------------------------------------------------===//
-
[LOOP OPTIMIZATION]
SingleSource/Benchmarks/Misc/dt.c shows several interesting optimization
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index e9394cd5c02..84e33f062b0 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -126,11 +126,6 @@ static void DeleteDeadInstruction(Instruction *I, ScalarEvolution &SE) {
bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) {
CurLoop = L;
- // We only look at trivial single basic block loops.
- // TODO: eventually support more complex loops, scanning the header.
- if (L->getBlocks().size() != 1)
- return false;
-
// The trip count of the loop must be analyzable.
SE = &getAnalysis<ScalarEvolution>();
if (!SE->hasLoopInvariantBackedgeTakenCount(L))
@@ -142,6 +137,11 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) {
TD = getAnalysisIfAvailable<TargetData>();
if (TD == 0) return false;
+ // TODO: We currently only scan the header of the loop, because it is the only
+ // part that is known to execute and we don't want to make a conditional store
+ // into an unconditional one in the preheader. However, there can be diamonds
+ // and other things in the loop that would make other blocks "always executed"
+ // we should get the full set and scan each block.
BasicBlock *BB = L->getHeader();
DEBUG(dbgs() << "loop-idiom Scanning: F[" << BB->getParent()->getName()
<< "] Loop %" << BB->getName() << "\n");
OpenPOWER on IntegriCloud