We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b666c7 commit ed476d6Copy full SHA for ed476d6
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -511,6 +511,12 @@ static bool isSplat(ArrayRef<Value *> VL) {
511
}
512
513
/// \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
520
static bool isCommutative(Instruction *I, Instruction *InstWithUses) {
521
if (auto *Cmp = dyn_cast<CmpInst>(I))
522
return Cmp->isCommutative();
0 commit comments