[llvm] [SLP] NFC. Replace MainOp and AltOp in TreeEntry with InstructionsState. (PR #122443)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 17 04:37:49 PST 2025
================
@@ -2414,15 +2414,16 @@ class BoUpSLP {
}
/// Go through the instructions in VL and append their operands.
- void appendOperandsOfVL(ArrayRef<Value *> VL, Instruction *VL0) {
+ void appendOperandsOfVL(ArrayRef<Value *> VL, const InstructionsState &S) {
assert(!VL.empty() && "Bad VL");
assert((empty() || VL.size() == getNumLanes()) &&
"Expected same number of lanes");
// IntrinsicInst::isCommutative returns true if swapping the first "two"
// arguments to the intrinsic produces the same result.
constexpr unsigned IntrinsicNumOperands = 2;
- unsigned NumOperands = VL0->getNumOperands();
- ArgSize = isa<IntrinsicInst>(VL0) ? IntrinsicNumOperands : NumOperands;
+ unsigned NumOperands = S.getMainOp()->getNumOperands();
----------------
alexey-bataev wrote:
```suggestion
Instruction *VL0 = S.getMainOp();
unsigned NumOperands = VL0->getNumOperands();
```
to prevent multiple references
https://github.com/llvm/llvm-project/pull/122443
More information about the llvm-commits
mailing list