diff options
| author | Dan Gohman <gohman@apple.com> | 2009-12-18 01:24:09 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-12-18 01:24:09 +0000 |
| commit | 18fa5686f6e06c60bcbfd20a6418c2e5bee8c856 (patch) | |
| tree | aece8390eca40bd85f9bbcfdf08589109e6271dc /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
| parent | fd7231f1fe2ceed126bee6593f940563158c690f (diff) | |
| download | bcm5719-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/LoopUnswitch.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index b7adfdc68e4..0c19133ed15 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -877,7 +877,7 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC, for (unsigned i = 0, e = Users.size(); i != e; ++i) if (Instruction *U = cast<Instruction>(Users[i])) { - if (!L->contains(U->getParent())) + if (!L->contains(U)) continue; U->replaceUsesOfWith(LIC, Replacement); Worklist.push_back(U); @@ -888,7 +888,7 @@ void LoopUnswitch::RewriteLoopBodyWithConditionConstant(Loop *L, Value *LIC, // can. This case occurs when we unswitch switch statements. for (unsigned i = 0, e = Users.size(); i != e; ++i) if (Instruction *U = cast<Instruction>(Users[i])) { - if (!L->contains(U->getParent())) + if (!L->contains(U)) continue; Worklist.push_back(U); |

