aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-09 16:17:52 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-09 16:17:52 +0000
commit833b2a7cc1cc7a801be96c62cdd62e539b2ce52c (patch)
treeb131a0129958bbcea11d25a1cd90d7a54721604f
parent8d4191d6429537222756caa1c45cd809b6c1ab7d (diff)
downloadexternal_llvm-833b2a7cc1cc7a801be96c62cdd62e539b2ce52c.zip
external_llvm-833b2a7cc1cc7a801be96c62cdd62e539b2ce52c.tar.gz
external_llvm-833b2a7cc1cc7a801be96c62cdd62e539b2ce52c.tar.bz2
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107981 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp
index d1b0e86..fe99daa 100644
--- a/lib/Transforms/Utils/BreakCriticalEdges.cpp
+++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp
@@ -106,11 +106,12 @@ bool llvm::isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
// If AllowIdenticalEdges is true, then we allow this edge to be considered
// non-critical iff all preds come from TI's block.
while (I != E) {
- if (*I != FirstPred)
+ const BasicBlock *P = *I;
+ if (P != FirstPred)
return true;
// Note: leave this as is until no one ever compiles with either gcc 4.0.1
// or Xcode 2. This seems to work around the pred_iterator assert in PR 2207
- E = pred_end(*I);
+ E = pred_end(P);
++I;
}
return false;