[llvm] [SLP] NFC. Refactor and add getAltInstrMask help function. (PR #94709)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 04:13:47 PDT 2024


================
@@ -983,6 +983,17 @@ static void fixupOrderingIndices(MutableArrayRef<unsigned> Order) {
   }
 }
 
+/// \returns a bitset for selecting opcodes. false for Opcode0 and true for
+/// Opcode1.
+SmallBitVector getAltInstrMask(ArrayRef<Value *> VL, unsigned Opcode0,
+                               unsigned Opcode1) {
+  SmallBitVector OpcodeMask(VL.size(), false);
+  for (unsigned Lane : seq<unsigned>(0, VL.size()))
----------------
alexey-bataev wrote:

```suggestion
  for (unsigned Lane : seq<unsigned>(VL.size()))
```

https://github.com/llvm/llvm-project/pull/94709


More information about the llvm-commits mailing list