aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-18 01:24:09 +0000
committerDan Gohman <gohman@apple.com>2009-12-18 01:24:09 +0000
commit92329c7fbe572892c17aa2d2542a10e3ea16132f (patch)
treece133aeb6883b2cb097896877b881cbb1340287a /lib/Analysis/LoopInfo.cpp
parent3ca735450db584068f07b728f0537c3e9208a699 (diff)
Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopInfo.cpp')
-rw-r--r--lib/Analysis/LoopInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/LoopInfo.cpp b/lib/Analysis/LoopInfo.cpp
index 34089ee59c..5d31c1157e 100644
--- a/lib/Analysis/LoopInfo.cpp
+++ b/lib/Analysis/LoopInfo.cpp
@@ -56,7 +56,7 @@ bool Loop::isLoopInvariant(Value *V) const {
/// loop-invariant.
///
bool Loop::isLoopInvariant(Instruction *I) const {
- return !contains(I->getParent());
+ return !contains(I);
}
/// makeLoopInvariant - If the given value is an instruciton inside of the