summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopIndexSplit.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/Transforms/Scalar/LoopIndexSplit.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/Transforms/Scalar/LoopIndexSplit.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
index 8b6a2334315..1d9dd684121 100644
--- a/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -288,7 +288,7 @@ bool LoopIndexSplit::runOnLoop(Loop *IncomingLoop, LPPassManager &LPM_Ref) {
// isUsedOutsideLoop - Returns true iff V is used outside the loop L.
static bool isUsedOutsideLoop(Value *V, Loop *L) {
for(Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
- if (!L->contains(cast<Instruction>(*UI)->getParent()))
+ if (!L->contains(cast<Instruction>(*UI)))
return true;
return false;
}
@@ -842,7 +842,7 @@ void LoopIndexSplit::updatePHINodes(BasicBlock *ExitBB, BasicBlock *Latch,
for (Value::use_iterator UI = PHV->use_begin(), E = PHV->use_end();
UI != E; ++UI)
if (PHINode *U = dyn_cast<PHINode>(*UI))
- if (LP->contains(U->getParent())) {
+ if (LP->contains(U)) {
NewV = U;
break;
}
OpenPOWER on IntegriCloud