aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/LoopInfo.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-09 10:32:31 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-09 10:32:31 +0000
commit4fd6b397031d7b5baa01849c065ad7ef70882d83 (patch)
tree401380f59d6058d9bd86a46a917a94c1702bfa8c /include/llvm/Analysis/LoopInfo.h
parentf6c166078f8f10006dcbdde081603eccccfcefbe (diff)
downloadexternal_llvm-4fd6b397031d7b5baa01849c065ad7ef70882d83.zip
external_llvm-4fd6b397031d7b5baa01849c065ad7ef70882d83.tar.gz
external_llvm-4fd6b397031d7b5baa01849c065ad7ef70882d83.tar.bz2
another case of reuse result of operator*, it is expensive to recompute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/LoopInfo.h')
-rw-r--r--include/llvm/Analysis/LoopInfo.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 9be01dd..4a5d592 100644
--- a/include/llvm/Analysis/LoopInfo.h
+++ b/include/llvm/Analysis/LoopInfo.h
@@ -285,12 +285,14 @@ public:
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
for (typename InvBlockTraits::ChildIteratorType PI =
InvBlockTraits::child_begin(Header),
- PE = InvBlockTraits::child_end(Header); PI != PE; ++PI)
- if (!contains(*PI)) { // If the block is not in the loop...
- if (Out && Out != *PI)
+ PE = InvBlockTraits::child_end(Header); PI != PE; ++PI) {
+ typename InvBlockTraits::NodeType *N = *PI;
+ if (!contains(N)) { // If the block is not in the loop...
+ if (Out && Out != N)
return 0; // Multiple predecessors outside the loop
- Out = *PI;
+ Out = N;
}
+ }
// Make sure there is only one exit out of the preheader.
assert(Out && "Header of loop has no predecessors from outside loop?");