forked from OSchip/llvm-project
parent
76b178d949
commit
a2250e923b
|
@ -1183,9 +1183,10 @@ static bool replaceMathCmpWithIntrinsic(BinaryOperator *BO, CmpInst *Cmp,
|
|||
|
||||
// Check that the insertion doesn't create a value that is live across more
|
||||
// than two blocks, so to minimise the increase in register pressure.
|
||||
if (BO->getParent() != Cmp->getParent()) {
|
||||
BasicBlock *Dominator = MathDominates ? BO->getParent() : Cmp->getParent();
|
||||
BasicBlock *Dominated = MathDominates ? Cmp->getParent() : BO->getParent();
|
||||
BasicBlock *MathBB = BO->getParent(), *CmpBB = Cmp->getParent();
|
||||
if (MathBB != CmpBB) {
|
||||
BasicBlock *Dominator = MathDominates ? MathBB : CmpBB;
|
||||
BasicBlock *Dominated = MathDominates ? CmpBB : MathBB;
|
||||
auto Successors = successors(Dominator);
|
||||
if (llvm::find(Successors, Dominated) == Successors.end())
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue