[SLP] move misplaced code comments; NFC

This commit is contained in:
Sanjay Patel 2020-09-21 17:22:58 -04:00
parent 062276c691
commit bbd49a0266
1 changed files with 4 additions and 3 deletions

View File

@ -6425,12 +6425,9 @@ class HorizontalReduction {
if (!IsRedOp)
return I->getParent() == P;
if (isMinMax()) {
// SelectInst must be used twice while the condition op must have single
// use only.
auto *Cmp = cast<Instruction>(cast<SelectInst>(I)->getCondition());
return I->getParent() == P && Cmp && Cmp->getParent() == P;
}
// Arithmetic reduction operation must be used once only.
return I->getParent() == P;
}
@ -6438,10 +6435,14 @@ class HorizontalReduction {
bool hasRequiredNumberOfUses(Instruction *I, bool IsReductionOp) const {
assert(Kind != RK_None && !!*this && LHS && RHS &&
"Expected reduction operation.");
// SelectInst must be used twice while the condition op must have single
// use only.
if (isMinMax())
return I->hasNUses(2) &&
(!IsReductionOp ||
cast<SelectInst>(I)->getCondition()->hasOneUse());
// Arithmetic reduction operation must be used once only.
return I->hasOneUse();
}