aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-06-11 19:22:28 +0000
committerOwen Anderson <resistor@mac.com>2006-06-11 19:22:28 +0000
commitc2cc15cf9d926b8de41dabba86005a55806127a0 (patch)
tree39d433091ee79472ea511a0d5a6f39ebd7725016 /lib/Analysis/LoopInfo.cpp
parentb9b2b309d3195d9e2ed1e72da8566a470783e8d7 (diff)
downloadexternal_llvm-c2cc15cf9d926b8de41dabba86005a55806127a0.zip
external_llvm-c2cc15cf9d926b8de41dabba86005a55806127a0.tar.gz
external_llvm-c2cc15cf9d926b8de41dabba86005a55806127a0.tar.bz2
Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28748 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index c7ce58e..eed2cd6 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -479,6 +479,22 @@ Value *Loop::getTripCount() const {
return 0;
}
+/// isLCSSAForm - Return true if the Loop is in LCSSA form
+bool Loop::isLCSSAForm() const {
+ for (Loop::block_iterator BB = block_begin(), E = block_end();
+ BB != E; ++BB) {
+ for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I)
+ for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
+ ++UI) {
+ BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
+ if (!isa<PHINode>(*UI) && !contains(UserBB)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
//===-------------------------------------------------------------------===//
// APIs for updating loop information after changing the CFG