1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

another case of reuse result of operator*, it is expensive to recompute

llvm-svn: 107960
This commit is contained in:
Gabor Greif 2010-07-09 10:32:31 +00:00
parent d266b0fcd8
commit 01db29c828

View File

@ -285,12 +285,14 @@ public:
typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits; typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
for (typename InvBlockTraits::ChildIteratorType PI = for (typename InvBlockTraits::ChildIteratorType PI =
InvBlockTraits::child_begin(Header), InvBlockTraits::child_begin(Header),
PE = InvBlockTraits::child_end(Header); PI != PE; ++PI) PE = InvBlockTraits::child_end(Header); PI != PE; ++PI) {
if (!contains(*PI)) { // If the block is not in the loop... typename InvBlockTraits::NodeType *N = *PI;
if (Out && Out != *PI) if (!contains(N)) { // If the block is not in the loop...
if (Out && Out != N)
return 0; // Multiple predecessors outside the loop return 0; // Multiple predecessors outside the loop
Out = *PI; Out = N;
} }
}
// Make sure there is only one exit out of the preheader. // Make sure there is only one exit out of the preheader.
assert(Out && "Header of loop has no predecessors from outside loop?"); assert(Out && "Header of loop has no predecessors from outside loop?");