[llvm] bbd49a0 - [SLP] move misplaced code comments; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 22 06:26:54 PDT 2020
Author: Sanjay Patel
Date: 2020-09-22T09:21:20-04:00
New Revision: bbd49a0266921ce68a8581b8ae3d5c88eda8c679
URL: https://github.com/llvm/llvm-project/commit/bbd49a0266921ce68a8581b8ae3d5c88eda8c679
DIFF: https://github.com/llvm/llvm-project/commit/bbd49a0266921ce68a8581b8ae3d5c88eda8c679.diff
LOG: [SLP] move misplaced code comments; NFC
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index da3342fa8eb7..0f9193e502a1 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -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();
}
More information about the llvm-commits
mailing list