summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit18fa5686f6e06c60bcbfd20a6418c2e5bee8c856 (patch)
treeaece8390eca40bd85f9bbcfdf08589109e6271dc /llvm/lib/Analysis/LoopInfo.cpp
parentfd7231f1fe2ceed126bee6593f940563158c690f (diff)
downloadbcm5719-llvm-18fa5686f6e06c60bcbfd20a6418c2e5bee8c856.tar.gz
bcm5719-llvm-18fa5686f6e06c60bcbfd20a6418c2e5bee8c856.zip
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. llvm-svn: 91654
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 34089ee59c4..5d31c1157e1 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud