summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-12 12:02:10 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-12 12:02:10 +0000
commit433b975fe2cb75551829a3697e38e72a18cca0c3 (patch)
treee93458adcc0c6eef0519082bf8536b98d1765f89 /llvm/lib/Transforms/Scalar/TailDuplication.cpp
parent35473faa5056aa3888ac20091f76fece02367f44 (diff)
downloadbcm5719-llvm-433b975fe2cb75551829a3697e38e72a18cca0c3.tar.gz
bcm5719-llvm-433b975fe2cb75551829a3697e38e72a18cca0c3.zip
recommit r108131 (hich has been backed out in r108135) with a fix
llvm-svn: 108137
Diffstat (limited to 'llvm/lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/TailDuplication.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
index 2306a77670f..9208238f4ba 100644
--- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
@@ -206,12 +206,13 @@ static BasicBlock *FindObviousSharedDomOf(BasicBlock *SrcBlock,
// there is only one other pred, get it, otherwise we can't handle it.
PI = pred_begin(DstBlock); PE = pred_end(DstBlock);
BasicBlock *DstOtherPred = 0;
- if (*PI == SrcBlock) {
+ BasicBlock *P = *PI;
+ if (P == SrcBlock) {
if (++PI == PE) return 0;
DstOtherPred = *PI;
if (++PI != PE) return 0;
} else {
- DstOtherPred = *PI;
+ DstOtherPred = P;
if (++PI == PE || *PI != SrcBlock || ++PI != PE) return 0;
}
OpenPOWER on IntegriCloud