Skip to content

Commit ed476d6

Browse files
committed
add comments
1 parent 0b666c7 commit ed476d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,12 @@ static bool isSplat(ArrayRef<Value *> VL) {
511511
}
512512

513513
/// \returns True if \p I is commutative, handles CmpInst and BinaryOperator.
514+
/// For BinaryOperator, it also checks if \p InstWithUses is used in specific
515+
/// patterns that make it effectively commutative (like equality comparisons
516+
/// with zero).
517+
/// \param I The instruction to check for commutativity
518+
/// \param InstWithUses The instruction whose uses are analyzed for special
519+
/// patterns
514520
static bool isCommutative(Instruction *I, Instruction *InstWithUses) {
515521
if (auto *Cmp = dyn_cast<CmpInst>(I))
516522
return Cmp->isCommutative();

0 commit comments

Comments
 (0)