Skip to content

Commit 9655dad

Browse files
committed
add comments
1 parent ed476d6 commit 9655dad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ static bool isSplat(ArrayRef<Value *> VL) {
514514
/// For BinaryOperator, it also checks if \p InstWithUses is used in specific
515515
/// patterns that make it effectively commutative (like equality comparisons
516516
/// with zero).
517+
/// In most cases, users should not call this function directly (since \p I and
518+
/// \p InstWithUses are the same). However, when analyzing interchangeable
519+
/// instructions, we need to use the converted opcode along with the original
520+
/// uses.
517521
/// \param I The instruction to check for commutativity
518522
/// \param InstWithUses The instruction whose uses are analyzed for special
519523
/// patterns
@@ -550,6 +554,7 @@ static bool isCommutative(Instruction *I, Instruction *InstWithUses) {
550554
return I->isCommutative();
551555
}
552556

557+
/// This is a helper function to check whether \p I is commutative.
553558
static bool isCommutative(Instruction *I) { return isCommutative(I, I); }
554559

555560
template <typename T>

0 commit comments

Comments
 (0)