diff options
Diffstat (limited to 'lib/Transforms/Scalar/CondPropagate.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CondPropagate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/CondPropagate.cpp b/lib/Transforms/Scalar/CondPropagate.cpp index f68fb292e4..1b755171c3 100644 --- a/lib/Transforms/Scalar/CondPropagate.cpp +++ b/lib/Transforms/Scalar/CondPropagate.cpp @@ -137,7 +137,7 @@ void CondProp::SimplifyPredecessors(BranchInst *BI) { if (!PN->hasOneUse()) return; BasicBlock *BB = BI->getParent(); - if (&*BB->begin() != PN || &*next(BB->begin()) != BI) + if (!isTerminatorFirstRelevantInsn (BB, BI)) return; // Ok, we have this really simple case, walk the PHI operands, looking for @@ -171,7 +171,7 @@ void CondProp::SimplifyPredecessors(SwitchInst *SI) { if (!PN->hasOneUse()) return; BasicBlock *BB = SI->getParent(); - if (&*BB->begin() != PN || &*next(BB->begin()) != SI) + if (!isTerminatorFirstRelevantInsn (BB, SI)) return; bool RemovedPreds = false; |