summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MustExecute.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2018-03-20 23:00:54 +0000
committerPhilip Reames <listmail@philipreames.com>2018-03-20 23:00:54 +0000
commit37a1a29fcb434f22f79be2d3d403edb9d0b879da (patch)
tree05220dfd6c6ee23b23ca1cb160e3133495693d4e /llvm/lib/Analysis/MustExecute.cpp
parent73a98f5eea43943726ec37e01e6daf13cfce4c39 (diff)
downloadbcm5719-llvm-37a1a29fcb434f22f79be2d3d403edb9d0b879da.tar.gz
bcm5719-llvm-37a1a29fcb434f22f79be2d3d403edb9d0b879da.zip
[MustExecute] Shwo the effect of using full loop info variant
Most basic possible test for the logic used by LICM. Also contains a speculative build fix for compiles which complain about a definition of a stuct K; followed by a declaration as class K; llvm-svn: 328058
Diffstat (limited to 'llvm/lib/Analysis/MustExecute.cpp')
-rw-r--r--llvm/lib/Analysis/MustExecute.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/MustExecute.cpp b/llvm/lib/Analysis/MustExecute.cpp
index c3b4de738b4..437946a6ebb 100644
--- a/llvm/lib/Analysis/MustExecute.cpp
+++ b/llvm/lib/Analysis/MustExecute.cpp
@@ -185,11 +185,13 @@ FunctionPass *llvm::createMustExecutePrinter() {
}
bool isMustExecuteIn(const Instruction &I, Loop *L, DominatorTree *DT) {
- // TODO: move loop specific code to analysis
- //LoopSafetyInfo LSI;
- //computeLoopSafetyInfo(&LSI, L);
- //return isGuaranteedToExecute(I, DT, L, &LSI);
- return isGuaranteedToExecuteForEveryIteration(&I, L);
+ // TODO: merge these two routines. For the moment, we display the best
+ // result obtained by *either* implementation. This is a bit unfair since no
+ // caller actually gets the full power at the moment.
+ LoopSafetyInfo LSI;
+ computeLoopSafetyInfo(&LSI, L);
+ return isGuaranteedToExecute(I, DT, L, &LSI) ||
+ isGuaranteedToExecuteForEveryIteration(&I, L);
}
/// \brief An assembly annotator class to print must execute information in
OpenPOWER on IntegriCloud