[llvm] [SDPatternMatch] Simplify EffectiveOperands and drop the template specialization. NFC (PR #226036)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 18:48:17 PDT 2026


================
@@ -404,29 +404,21 @@ template <bool ExcludeChain> struct EffectiveOperands {
   unsigned Size = 0;
   unsigned FirstIndex = 0;
 
-  explicit EffectiveOperands(SDValue N) {
-    const unsigned TotalNumOps = N->getNumOperands();
-    FirstIndex = TotalNumOps;
-    for (unsigned I = 0; I < TotalNumOps; ++I) {
-      // Count the number of non-chain and non-glue nodes (we ignore chain
-      // and glue by default) and retreive the operand index offset.
-      EVT VT = N->getOperand(I).getValueType();
-      if (VT != MVT::Glue && VT != MVT::Other) {
-        ++Size;
-        if (FirstIndex == TotalNumOps)
-          FirstIndex = I;
+  explicit EffectiveOperands(SDValue N)
+      : Size(N->getNumOperands()) {
----------------
topperc wrote:

```suggestion
  explicit EffectiveOperands(SDValue N) : Size(N->getNumOperands()) {
```

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


More information about the llvm-commits mailing list