diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/TailDuplication.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp index 2306a77670f..febc872d930 100644 --- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp +++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp @@ -206,13 +206,14 @@ 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; + DstOtherPred = P; if (++PI != PE) return 0; } else { - DstOtherPred = *PI; - if (++PI == PE || *PI != SrcBlock || ++PI != PE) return 0; + DstOtherPred = P; + if (++PI == PE || P != SrcBlock || ++PI != PE) return 0; } // We can handle two situations here: "if then" and "if then else" blocks. An |