Skip to content

[GlobalISel][TableGen] MIR Pattern Variadics #100563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

Pierre-vh
Copy link
Contributor

Allow for matching & rewriting a variable number of arguments in an instructions.

Solves #87459

Allow for matching & rewriting a variable number of arguments in an instructions.

Solves llvm#87459
@llvmbot
Copy link
Member

llvmbot commented Jul 25, 2024

@llvm/pr-subscribers-llvm-globalisel

Author: Pierre van Houtryve (Pierre-vh)

Changes

Allow for matching & rewriting a variable number of arguments in an instructions.

Solves #87459


Patch is 53.41 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/100563.diff

15 Files Affected:

  • (modified) llvm/docs/GlobalISel/MIRPatterns.rst (+54-1)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h (+16)
  • (modified) llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h (+33)
  • (modified) llvm/include/llvm/Target/GlobalISel/Combine.td (+10)
  • (modified) llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-variadics.td (+47-7)
  • (modified) llvm/test/TableGen/GlobalISelCombinerEmitter/operand-types.td (+25-1)
  • (modified) llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td (+11-3)
  • (added) llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td (+75)
  • (modified) llvm/utils/TableGen/Common/GlobalISel/CodeExpander.h (+1-1)
  • (modified) llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp (+42-23)
  • (modified) llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h (+48-17)
  • (modified) llvm/utils/TableGen/Common/GlobalISel/Patterns.cpp (+39)
  • (modified) llvm/utils/TableGen/Common/GlobalISel/Patterns.h (+26-2)
  • (modified) llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp (+138-47)
  • (modified) llvm/utils/TableGen/GlobalISelEmitter.cpp (+2-2)
diff --git a/llvm/docs/GlobalISel/MIRPatterns.rst b/llvm/docs/GlobalISel/MIRPatterns.rst
index 7e6d88683d491..abc23985a6fac 100644
--- a/llvm/docs/GlobalISel/MIRPatterns.rst
+++ b/llvm/docs/GlobalISel/MIRPatterns.rst
@@ -115,7 +115,7 @@ GITypeOf
 ``GITypeOf<"$x">`` is a ``GISpecialType`` that allows for the creation of a
 register or immediate with the same type as another (register) operand.
 
-Operand:
+Type Parameters:
 
 * An operand name as a string, prefixed by ``$``.
 
@@ -143,6 +143,57 @@ Semantics:
     (apply (G_FSUB $dst, $src, $tmp),
            (G_FNEG GITypeOf<"$dst">:$tmp, $src))>;
 
+GIVariadic
+~~~~~~~~~~
+
+``GIVariadic<>`` is a ``GISpecialType`` that allows for matching 1 or
+more operands remaining on an instruction.
+
+Type Parameters:
+
+* The minimum number of additional operands to match. Must be greater than zero.
+
+  * Default is 1.
+
+* The maximum number of additional operands to match. Must be strictly greater
+  than the minimum.
+
+  * 0 can be used to indicate there is no upper limit.
+  * Default is 0.
+
+Semantics:
+
+* ``GIVariadic<>`` operands can not be defs.
+* ``GIVariadic<>`` operands can only appear as the last operand in a 'match' pattern.
+* Each instance within a 'match' pattern must be uniquely named.
+* Re-using a ``GIVariadic<>`` operand in an 'apply' pattern will result in all
+  the matched operands being copied from the original instruction.
+* The min/max operands will result in the matcher checking that the number of operands
+  falls within that range.
+* ``GIVariadic<>`` operands can be used in C++ code within a rule, which will
+  result in the operand name being expanded to an iterator range containing all
+  the matched operands, similar to the one returned by ``MachineInstr::operands()``.
+
+.. code-block:: text
+
+  def build_vector_to_unmerge: GICombineRule <
+    (defs root:$root),
+    (match (G_BUILD_VECTOR $root, GIVariadic<>:$args),
+           [{ return checkBuildVectorToUnmerge(${args}); }]),
+    (apply (G_UNMERGE_VALUES $root, $args))
+  >;
+
+.. code-block:: text
+
+  // Will additionally check the number of operands is >= 3 and <= 5.
+  // ($root is one operand, then 2 to 4 variadic operands).
+  def build_vector_to_unmerge: GICombineRule <
+    (defs root:$root),
+    (match (G_BUILD_VECTOR $root, GIVariadic<2, 4>:$two_to_four),
+           [{ return checkBuildVectorToUnmerge(${two_to_four}); }]),
+    (apply (G_UNMERGE_VALUES $root, $two_to_four))
+  >;
+
 Builtin Operations
 ------------------
 
@@ -240,6 +291,8 @@ This a non-exhaustive list of known issues with MIR patterns at this time.
   match. e.g. if a pattern needs to work on both i32 and i64, you either
   need to leave it untyped and check the type in C++, or duplicate the
   pattern.
+* ``GISpecialType`` operands are not allowed within a ``GICombinePatFrag``.
+* ``GIVariadic<>`` matched operands must each have a unique name.
 
 GICombineRule
 -------------
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
index cc2dd2f4e489c..d7b9c96f1c01e 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h
@@ -133,6 +133,12 @@ enum {
   /// - Ops(ULEB128) - Expected number of operands
   GIM_CheckNumOperands,
 
+  /// Check the instruction has a number of operands <= or >= than given number.
+  /// - InsnID(ULEB128) - Instruction ID
+  /// - Ops(ULEB128) - Number of operands
+  GIM_CheckNumOperandsLE,
+  GIM_CheckNumOperandsGE,
+
   /// Check an immediate predicate on the specified instruction
   /// - InsnID(ULEB128) - Instruction ID
   /// - Pred(2) - The predicate to test
@@ -294,12 +300,15 @@ enum {
   /// Check the specified operands are identical.
   /// The IgnoreCopies variant looks through COPY instructions before
   /// comparing the operands.
+  /// The "All" variants check all operands starting from the index.
   /// - InsnID(ULEB128) - Instruction ID
   /// - OpIdx(ULEB128) - Operand index
   /// - OtherInsnID(ULEB128) - Other instruction ID
   /// - OtherOpIdx(ULEB128) - Other operand index
   GIM_CheckIsSameOperand,
   GIM_CheckIsSameOperandIgnoreCopies,
+  GIM_CheckAllSameOperand,
+  GIM_CheckAllSameOperandIgnoreCopies,
 
   /// Check we can replace all uses of a register with another.
   /// - OldInsnID(ULEB128)
@@ -362,6 +371,13 @@ enum {
   /// GIR_Copy but with both New/OldInsnIDs omitted and defaulting to zero.
   GIR_RootToRootCopy,
 
+  /// Copies all operand starting from OpIdx in OldInsnID into the new
+  /// instruction NewInsnID.
+  /// - NewInsnID(ULEB128) - Instruction ID to modify
+  /// - OldInsnID(ULEB128) - Instruction ID to copy from
+  /// - OpIdx(ULEB128) - The first operand to copy
+  GIR_CopyRemaining,
+
   /// Copy an operand to the specified instruction or add a zero register if the
   /// operand is a zero immediate.
   /// - NewInsnID(ULEB128) - Instruction ID to modify
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
index 90b4fe5518c87..5a5a750ac6b4a 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/GIMatchTableExecutorImpl.h
@@ -309,6 +309,23 @@ bool GIMatchTableExecutor::executeMatchTable(
       break;
     }
 
+    case GIM_CheckNumOperandsGE:
+    case GIM_CheckNumOperandsLE: {
+      uint64_t InsnID = readULEB();
+      uint64_t Expected = readULEB();
+      const bool IsLE = (MatcherOpcode == GIM_CheckNumOperandsLE);
+      DEBUG_WITH_TYPE(TgtExecutor::getName(),
+                      dbgs() << CurrentIdx << ": GIM_CheckNumOperands"
+                             << (IsLE ? "LE" : "GE") << "(MIs[" << InsnID
+                             << "], Expected=" << Expected << ")\n");
+      assert(State.MIs[InsnID] != nullptr && "Used insn before defined");
+      const unsigned NumOps = State.MIs[InsnID]->getNumOperands();
+      if (IsLE ? (NumOps <= Expected) : (NumOps >= Expected)) {
+        if (handleReject() == RejectAndGiveUp)
+          return false;
+      }
+      break;
+    }
     case GIM_CheckNumOperands: {
       uint64_t InsnID = readULEB();
       uint64_t Expected = readULEB();
@@ -1081,6 +1098,22 @@ bool GIMatchTableExecutor::executeMatchTable(
       break;
     }
 
+    case GIR_CopyRemaining: {
+      uint64_t NewInsnID = readULEB();
+      uint64_t OldInsnID = readULEB();
+      uint64_t OpIdx = readULEB();
+      assert(OutMIs[NewInsnID] && "Attempted to add to undefined instruction");
+      MachineInstr &OldMI = *State.MIs[OldInsnID];
+      MachineInstrBuilder &NewMI = OutMIs[NewInsnID];
+      for (const auto &Op : drop_begin(OldMI.operands(), OpIdx))
+        NewMI.add(Op);
+      DEBUG_WITH_TYPE(TgtExecutor::getName(),
+                      dbgs() << CurrentIdx << ": GIR_CopyRemaining(OutMIs["
+                             << NewInsnID << "], MIs[" << OldInsnID
+                             << "], /*start=*/" << OpIdx << ")\n");
+      break;
+    }
+
     case GIR_CopyOrAddZeroReg: {
       uint64_t NewInsnID = readULEB();
       uint64_t OldInsnID = readULEB();
diff --git a/llvm/include/llvm/Target/GlobalISel/Combine.td b/llvm/include/llvm/Target/GlobalISel/Combine.td
index 3ef0636ebf1c7..5c5ad1f6077a6 100644
--- a/llvm/include/llvm/Target/GlobalISel/Combine.td
+++ b/llvm/include/llvm/Target/GlobalISel/Combine.td
@@ -128,6 +128,16 @@ class GITypeOf<string opName> : GISpecialType {
   string OpName = opName;
 }
 
+// The type of an operand that can match a variable amount of operands.
+// This type contains a minimum and maximum number of operands to match.
+// The minimum must be 1 or more, as we cannot have an operand representing
+// zero operands, and the max can be zero (which means "unlimited") or a value
+// greater than the minimum.
+class GIVariadic<int min = 1, int max = 0> : GISpecialType {
+  int MinArgs = min;
+  int MaxArgs = max;
+}
+
 //===----------------------------------------------------------------------===//
 // Pattern Builtins
 //===----------------------------------------------------------------------===//
diff --git a/llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-variadics.td b/llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-variadics.td
index 86ae031caecb5..e3061e2f4d3e5 100644
--- a/llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-variadics.td
+++ b/llvm/test/TableGen/GlobalISelCombinerEmitter/match-table-variadics.td
@@ -28,19 +28,31 @@ def InstTest3 : GICombineRule<
   (match (G_UNMERGE_VALUES $a, $b, $c, $d)),
   (apply [{ APPLY }])>;
 
+def VariadicTypeTestCxx : GICombineRule<
+  (defs root:$a),
+  (match (G_BUILD_VECTOR $a, GIVariadic<2, 4>:$b)),
+  (apply [{ ${b} }])>;
+
+def VariadicTypeTestReuse : GICombineRule<
+  (defs root:$a),
+  (match (G_BUILD_VECTOR $a, $c, GIVariadic<2, 4>:$b)),
+  (apply (G_MERGE_VALUES $a, $b, $c))>;
+
 def MyCombiner: GICombiner<"GenMyCombiner", [
   InstTest0,
   InstTest1,
   InstTest2,
-  InstTest3
+  InstTest3,
+  VariadicTypeTestCxx,
+  VariadicTypeTestReuse
 ]>;
 
 // CHECK:      const uint8_t *GenMyCombiner::getMatchTable() const {
 // CHECK-NEXT:   constexpr static uint8_t MatchTable0[] = {
-// CHECK-NEXT:     GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2([[#LOWER:]]), GIMT_Encode2([[#UPPER:]]), /*)*//*default:*//*Label 2*/ GIMT_Encode4([[#DEFAULT:]]),
+// CHECK-NEXT:     GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(70), GIMT_Encode2(74), /*)*//*default:*//*Label 2*/ GIMT_Encode4(127),
 // CHECK-NEXT:     /*TargetOpcode::G_UNMERGE_VALUES*//*Label 0*/ GIMT_Encode4(26), GIMT_Encode4(0), GIMT_Encode4(0),
 // CHECK-NEXT:     /*TargetOpcode::G_BUILD_VECTOR*//*Label 1*/ GIMT_Encode4(55),
-// CHECK-NEXT:     // Label 0: @[[#%u, mul(UPPER-LOWER, 4) + 10]]
+// CHECK-NEXT:     // Label 0: @26
 // CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 3*/ GIMT_Encode4(40), // Rule ID 2 //
 // CHECK-NEXT:       GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
 // CHECK-NEXT:       GIM_CheckNumOperands, /*MI*/0, /*Expected*/2,
@@ -77,7 +89,35 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
 // CHECK-NEXT:       // Combiner Rule #1: InstTest1
 // CHECK-NEXT:       GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
 // CHECK-NEXT:     // Label 5: @69
-// CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 6*/ GIMT_Encode4(83), // Rule ID 0 //
+// CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 6*/ GIMT_Encode4(86), // Rule ID 4 //
+// CHECK-NEXT:       GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
+// CHECK-NEXT:       GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/3,
+// CHECK-NEXT:       GIM_CheckNumOperandsLE, /*MI*/0, /*Expected*/5,
+// CHECK-NEXT:       // MIs[0] a
+// CHECK-NEXT:       // No operand predicates
+// CHECK-NEXT:       // MIs[0] b
+// CHECK-NEXT:       // No operand predicates
+// CHECK-NEXT:       // Combiner Rule #4: VariadicTypeTestCxx
+// CHECK-NEXT:       GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
+// CHECK-NEXT:     // Label 6: @86
+// CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 7*/ GIMT_Encode4(112), // Rule ID 5 //
+// CHECK-NEXT:       GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
+// CHECK-NEXT:       GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/4,
+// CHECK-NEXT:       GIM_CheckNumOperandsLE, /*MI*/0, /*Expected*/6,
+// CHECK-NEXT:       // MIs[0] a
+// CHECK-NEXT:       // No operand predicates
+// CHECK-NEXT:       // MIs[0] c
+// CHECK-NEXT:       // No operand predicates
+// CHECK-NEXT:       // MIs[0] b
+// CHECK-NEXT:       // No operand predicates
+// CHECK-NEXT:       // Combiner Rule #5: VariadicTypeTestReuse
+// CHECK-NEXT:       GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_MERGE_VALUES),
+// CHECK-NEXT:       GIR_RootToRootCopy, /*OpIdx*/0, // a
+// CHECK-NEXT:       GIR_CopyRemaining, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/2, // b
+// CHECK-NEXT:       GIR_RootToRootCopy, /*OpIdx*/1, // c
+// CHECK-NEXT:       GIR_EraseRootFromParent_Done,
+// CHECK-NEXT:     // Label 7: @112
+// CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 8*/ GIMT_Encode4(126), // Rule ID 0 //
 // CHECK-NEXT:       GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
 // CHECK-NEXT:       GIM_CheckNumOperands, /*MI*/0, /*Expected*/4,
 // CHECK-NEXT:       // MIs[0] a
@@ -90,10 +130,10 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
 // CHECK-NEXT:       // No operand predicates
 // CHECK-NEXT:       // Combiner Rule #0: InstTest0
 // CHECK-NEXT:       GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
-// CHECK-NEXT:     // Label 6: @83
+// CHECK-NEXT:     // Label 8: @126
 // CHECK-NEXT:     GIM_Reject,
-// CHECK-NEXT:     // Label 2: @[[#%u, DEFAULT]]
+// CHECK-NEXT:     // Label 2: @127
 // CHECK-NEXT:     GIM_Reject,
-// CHECK-NEXT:     }; // Size: [[#%u, DEFAULT + 1]] bytes
+// CHECK-NEXT:     }; // Size: 128 bytes
 // CHECK-NEXT:   return MatchTable0;
 // CHECK-NEXT: }
diff --git a/llvm/test/TableGen/GlobalISelCombinerEmitter/operand-types.td b/llvm/test/TableGen/GlobalISelCombinerEmitter/operand-types.td
index 4769bed972401..9b5598661c8de 100644
--- a/llvm/test/TableGen/GlobalISelCombinerEmitter/operand-types.td
+++ b/llvm/test/TableGen/GlobalISelCombinerEmitter/operand-types.td
@@ -104,8 +104,32 @@ def TypeOfProp : GICombineRule<
   (apply (G_ANYEXT $x, GITypeOf<"$y">:$tmp),
          (G_ANYEXT $tmp, $y))>;
 
+// CHECK:      (CombineRule name:VariadicTypeTest id:3 root:a
+// CHECK-NEXT:   (MatchPats
+// CHECK-NEXT:     <match_root>__VariadicTypeTest_match_0:(CodeGenInstructionPattern G_UNMERGE_VALUES operands:[<def>$a, <def>$b, GIVariadic<1,0>:$z])
+// CHECK-NEXT:   )
+// CHECK-NEXT:   (ApplyPats
+// CHECK-NEXT:     <apply_root>__VariadicTypeTest_apply_0:(CodeGenInstructionPattern G_UNMERGE_VALUES operands:[<def>$a, <def>$b, GIVariadic<1,0>:$z])
+// CHECK-NEXT:   )
+// CHECK-NEXT:   (OperandTable MatchPats
+// CHECK-NEXT:     a -> __VariadicTypeTest_match_0
+// CHECK-NEXT:     b -> __VariadicTypeTest_match_0
+// CHECK-NEXT:     z -> <live-in>
+// CHECK-NEXT:   )
+// CHECK-NEXT:   (OperandTable ApplyPats
+// CHECK-NEXT:     a -> __VariadicTypeTest_apply_0
+// CHECK-NEXT:     b -> __VariadicTypeTest_apply_0
+// CHECK-NEXT:     z -> <live-in>
+// CHECK-NEXT:   )
+// CHECK-NEXT: )
+def VariadicTypeTest: GICombineRule<
+  (defs root:$a),
+  (match (G_UNMERGE_VALUES $a, $b, GIVariadic<>:$z)),
+  (apply (G_UNMERGE_VALUES $a, $b, $z))>;
+
 def MyCombiner: GICombiner<"GenMyCombiner", [
   InstTest0,
   PatFragTest0,
-  TypeOfProp
+  TypeOfProp,
+  VariadicTypeTest,
 ]>;
diff --git a/llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td b/llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td
index ee7b8f5f3a39c..900a4bb902f7c 100644
--- a/llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td
+++ b/llvm/test/TableGen/GlobalISelCombinerEmitter/typeof-errors.td
@@ -21,7 +21,7 @@ def UnknownOperand : GICombineRule<
   (match (G_ZEXT $dst, $src)),
   (apply (G_ANYEXT $dst, (GITypeOf<"$unknown"> 0)))>;
 
-// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: GISpecialType is not supported in 'match' patterns
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: GITypeOf is not supported in 'match' patterns
 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: note: operand 1 of '__UseInMatch_match_0' has type 'GITypeOf<$dst>'
 def UseInMatch : GICombineRule<
   (defs root:$dst),
@@ -41,7 +41,7 @@ def UseInPF: GICombineRule<
   (match (PFWithTypeOF $dst)),
   (apply (G_ANYEXT $dst, (i32 0)))>;
 
-// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: GISpecialType is not supported in 'match' patterns
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: GITypeOf is not supported in 'match' patterns
 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: note: operand 1 of '__InferredUseInMatch_match_0' has type 'GITypeOf<$dst>'
 def InferredUseInMatch : GICombineRule<
   (defs root:$dst),
@@ -63,6 +63,13 @@ def TypeOfApplyTmp : GICombineRule<
   (apply (G_ANYEXT $dst, i32:$tmp),
          (G_ANYEXT $tmp, (GITypeOf<"$tmp"> 0)))>;
 
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: type 'GITypeOf<$src>' is ill-formed: 'src' is a variadic pack operand
+def TypeOfVariadic : GICombineRule<
+  (defs root:$dst),
+  (match (G_ZEXT $dst,  GIVariadic<>:$src)),
+  (apply (G_ANYEXT GITypeOf<"$src">:$tmp, $src),
+         (G_ANYEXT $dst, $tmp))>;
+
 // CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse one or more rules
 def MyCombiner: GICombiner<"GenMyCombiner", [
   NoDollarSign,
@@ -71,5 +78,6 @@ def MyCombiner: GICombiner<"GenMyCombiner", [
   UseInPF,
   InferredUseInMatch,
   InferenceConflict,
-  TypeOfApplyTmp
+  TypeOfApplyTmp,
+  TypeOfVariadic
 ]>;
diff --git a/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td b/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
new file mode 100644
index 0000000000000..68929c09da8d2
--- /dev/null
+++ b/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
@@ -0,0 +1,75 @@
+// RUN: not llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \
+// RUN:     -combiners=MyCombiner %s 2>&1| \
+// RUN: FileCheck %s -implicit-check-not=error:
+
+include "llvm/Target/Target.td"
+include "llvm/Target/GlobalISel/Combine.td"
+
+def MyTargetISA : InstrInfo;
+def MyTarget : Target { let InstructionSet = MyTargetISA; }
+
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 'G_BUILD_VECTOR': GIVariadic can only be used on the last operand
+def VariadicNotLastInList : GICombineRule<
+  (defs root:$dst),
+  (match (G_BUILD_VECTOR $dst, $a, GIVariadic<>:$b, $c)),
+  (apply (G_ANYEXT $dst, $a))>;
+
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 'G_IMPLICIT_DEF': GIVariadic cannot be used on defs
+def VariadicAsDef : GICombineRule<
+  (defs root:$dst),
+  (match (G_IMPLICIT_DEF GIVariadic<1>:$dst)),
+  (apply [{ APPLY }])>;
+
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: conflicting types for operand 'args': 'GIVariadic<2,4>' vs 'GIVariadic<3,6>'
+def ConflictingInference : GICombineRule<
+  (defs root:$dst),
+  (match (G_BUILD_VECTOR $dst, GIVariadic<2, 4>:$args)),
+  (apply (G_MERGE_VALUES $dst, GIVariadic<3, 6>:$args))>;
+
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
+def InvalidBounds0 : GICombineRule<
+  (defs root:$dst),
+  (match (G_BUILD_VECTOR $dst, GIVariadic<0>:$a)),
+  (apply [{ APPLY }])>;
+
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: cannot parse operand type: maximum number of arguments (1) must be zero, or greater than the minimum number of arguments (1) in GIVariadic
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
+def InvalidBounds1 : GICombineRule<
+  (defs root:$dst),
+  (match (G_BUILD_VECTOR $dst, GIVariadic<1,1>:$a)),
+  (apply [{ APPLY }])>;
+
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: each instance of a GIVariadic operand must have a unique name within the match patterns
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: note: 'c' is used multiple times
+def VariadicTypeTestEqOp : GICombineRule<
+  (defs root:$a),
+  (match (G_MERGE_VALUES $b, $c),
+         (G_BUILD_VECTOR $a, $b, GIVariadic<2, 4>:$c)),
+  (apply (G_MERGE_VALUES $a, $c))>;
+
+// TODO: We could support this if needed
+
+// CHECK: :[[@LINE+3]]:{{[0-9]+}}: error: GISpecialType is not supported in GICombinePatFrag
+// CHECK: :[[@LINE+2]]:{{[0-9]+}}: note: operand 1 of '__PFWithVariadic_alt0_pattern_0' has type 'GIVariadic<1,0
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Could not parse GICombinePatFrag 'PFWithVariadic'
+def PFWithVariadic: GICombinePatFrag<
+    (outs $dst), (ins),
+    [(pattern (G_ANYEXT $dst, GIVariadic<>:$b))]>;
+
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(PFWithVariadic ?:$dst)'
+def UseInPF: GICombineRule<
+  (defs root:$dst),
+  (match (PFWithVariadic $dst)),
+  (apply (G_ANYEXT $dst, (i32 0)))>;
+
+// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse one or more rules
+def MyCombiner: GICombiner<"GenMyCombiner", [
+  VariadicNotLastInList,
+  VariadicAsDef,
+  ConflictingInference,
+  InvalidBounds0,
+  InvalidBounds1,
+  VariadicTypeTestEqOp,
+  UseInPF
+]>;
diff --git a/llvm/utils/TableGen/Common/GlobalISel/CodeExp...
[truncated]

Copy link

github-actions bot commented Jul 25, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Comment on lines +181 to +182
(match (G_BUILD_VECTOR $root, GIVariadic<>:$args),
[{ return checkBuildVectorToUnmerge(${args}); }]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include an example of unpacking the first N args? Like
G_BUILD_VECTOR $root, $srca, $srcb, ...:$remainder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not yet implemented for MIR patterns. In C++ you can just convert the iterator_range to an ArrayRef I think.
I need some ideas on how to proceed

What kind of operations do we want?

  • Only head/tail of the list, or do we need specific indexes?
  • Do we need one element at a time, or multiple ?

Coming up with some example patterns would greatly help. I'm not sure how unpacking would be used in practice, because we don't have loops, so we can't do things like "for each element, emit this"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that what's going in in VariadicTypeTestReuse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that just takes the N matched operands and puts them at a different position in the output instruction.
So $b can represent 2 to 4 operands, and the output instruction has $a, $b (so 2 to 4 operands being put here), and $c

It's a test to check that in apply patterns, a matched variadic can go anywhere, but in a match pattern it can only go at the end

Note that this whole thing is very much a prototype implementation, I put it up for review to discuss things like this and refine it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you spell out the signature of checkBuildVectorToUnmerge? In particular, I am interested in the argument type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought ArrayRef<MachineOperand> would work out of the box but to my surprise, ArrayRef did not have a constructor from iterator_range. I tried adding one, but after 10 minutes of fighting templates (because we'd need one for both const and non-const ranges, and it apparently doesn't work), I gave up and made a helper function to do the conversion.

So now it's really just a ArrayRef<MachineOperand>, created through GIMatchTableExecutor::getVariadicOperands.

@tschuett
Copy link

tschuett commented Jul 25, 2024

Can I write:

  (match (G_BUILD_VECTOR $bv,  GIVariadic<>):$BV,
  (G_TRUNC $root, $bv):$Trunc,
  [{ return matchTruncOfBuildvector(*${Trunc}, *${BV}, ${matchinfo}); }]),

May not compile.

@Pierre-vh
Copy link
Contributor Author

Can I write:

  (match (G_BUILD_VECTOR $bv,  GIVariadic<>):$BV,
  (G_TRUNC $root, $bv):$Trunc,
  [{ return matchTruncOfBuildvector(*${Trunc}, *${BV}, ${matchinfo}); }]),

May not compile.

The variadic operand must have a name, other than that, yes it'll work.

@tschuett
Copy link

 (match (G_BUILD_VECTOR $bv,  GIVariadic<>:$varadic):$BV,
        (G_TRUNC $root, $bv):$Trunc,
        [{ return matchTruncOfBuildvector(*${Trunc}, *${BV}, ${matchinfo}); }]),

@tschuett
Copy link

Does it work with G_CONCAT_VECTORS? If it does, then a test would be nice.

@@ -1405,20 +1415,28 @@ class InstructionOpcodeMatcher : public InstructionPredicateMatcher {
};

class InstructionNumOperandsMatcher final : public InstructionPredicateMatcher {
public:
enum CheckKind { CK_Eq, CK_LE, CK_GE };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum class and without prefix.

@Pierre-vh
Copy link
Contributor Author

Does it work with G_CONCAT_VECTORS? If it does, then a test would be nice.

What do you mean?
It works with any instruction, as long as the variadic operands aren't defs.
(Which would be a pain to make work but isn't impossible)

@tschuett
Copy link

Does it work with G_CONCAT_VECTORS? If it does, then a test would be nice.

What do you mean? It works with any instruction, as long as the variadic operands aren't defs. (Which would be a pain to make work but isn't impossible)

Thanks.

@@ -1726,9 +1738,10 @@ OperandMatcher &InstructionMatcher::addPhysRegInput(Record *Reg, unsigned OpIdx,

void InstructionMatcher::emitPredicateOpcodes(MatchTable &Table,
RuleMatcher &Rule) {
if (NumOperandsCheck)
InstructionNumOperandsMatcher(InsnVarID, getNumOperands())
if (canAddNumOperandsCheck()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the curly braces necessary for semantics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the coding style recommends to use curly braces if the body of the if is more than 1 line, even if it's just a single statement that is more than 80 cols.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Similarly, braces should be used when a single-statement body is complex enough that it becomes difficult to see where the block containing the following statement began. An if/else chain or a loop is considered a single statement for this rule, and this rule applies recursively."

I will always vote in favor of braces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just a grey area. I'm the primary contributor to these files and I always use curly braces when the if's body spans multiple lines, and I think consistency takes priority.

NumOperandsCheck = false;
// FIXME: Is this even needed still? Why the isVariadicNumOperands check?
if (canAddNumOperandsCheck() && OpcMatcher.isVariadicNumOperands() &&
getNumOperandMatchers() != 0) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the curly braces necessary for semantics?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope.

@@ -713,6 +731,12 @@ class GIMatchTableExecutor {
return Ret;
}

static ArrayRef<MachineOperand> getVariadicOperands(const MachineInstr &MI,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to something more generic, given that the number of operands to skip. Alternatively infer from the instruction properties where the variadic arguments begin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, this can probably go into a separate file as well with other Combiner utils.

The direction I took with GIVariadic is that it's just a "variable operand pack", so 1 or more operands bundled together. It's not tied to the nature of the instruction itself.
You could write G_MUL $x, GIVariadic<>:$lhsAndRhs and that would also work.

Writing that now I realize that maybe this should be called something else, maybe something like a operand "bundle" or "pack". Or I should revert that decision and make it all about variadic instructions?

I like the idea of making them neutral because it gives more room to breathe for future feature, for instance if we have some kind of templated pattern for multiple opcodes each with a different number of inputs, we could use a GIVariadic to model the operands.

@Pierre-vh
Copy link
Contributor Author

For awareness: This is pretty much a WIP, it's complete as-is and could land - hence why no WIP tag - but suggestions are highly welcome. If you feel like this isn't usable without some limitations being lifted (such as having variadic defs), or some feature added (like extracting individual operands in the pack), let me know and give me your thoughts/syntax ideas/etc.

I can make a forum post if the discussion really picks up too

@tschuett
Copy link

This is awesome.

// Push cast through build vector.
class buildvector_of_opcode<Instruction castOpcode> : GICombineRule <
  (defs root:$root, build_fn_matchinfo:$matchinfo),
  (match (G_BUILD_VECTOR $bv, GIVariadic<>:$unused):$Build,
         (castOpcode $root, $bv):$Cast,
         [{ return matchCastOfBuildVector(*${Cast}, *${Build}, ${matchinfo}); }]),
  (apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;

def buildvector_of_zext : buildvector_of_opcode<G_ZEXT>;
def buildvector_of_anyext : buildvector_of_opcode<G_ANYEXT>;
def buildvector_of_truncate : buildvector_of_opcode<G_TRUNC>;

@tschuett
Copy link

G_MUL $x, GIVariadic<>:$lhsAndRhsshould give an error. G_MUL is not variadic. It is a misuse of the feature.

@tschuett
Copy link

defs will probably need a different syntax.

@Pierre-vh
Copy link
Contributor Author

G_MUL $x, GIVariadic<>:$lhsAndRhsshould give an error. G_MUL is not variadic. It is a misuse of the feature.

I'm really not convinced this count as a misuse, but I also struggle to imagine a use case where GIVariadic could be used outside a variadic instruction. I was thinking having templated pattern where the instructions have different number of opcodes but it's kind
of a stretch. I'll think about it a bit more.

defs will probably need a different syntax.

For defs we could just have things like G_UNMERGE_VALUES GIVariadic<>:$defs, $aggregate.
The complexity isn't in the syntax but in how the resulting pattern gets generated, because now we no longer know the index of $aggregate - it depends on the size of defs.
I would need a way to encode operands starting from the back, so maybe have reverse indexes (e.g. -1 is last operand). Or a way to index the defs and use separately (perhaps with some opcodes changing the indexing mode). Any solution implies a lot of change to pattern codegen so that's part of the reason why I don't want to tackle this now (this patch is already pretty big as is)

@tschuett
Copy link

This is already great. If somebody needs variadic defs, he can open a ticket.

@tschuett
Copy link

A future version:

G_BUILD_VECTOR $bv, GIVariadic<TargetOpcode::G_CONSTANT>:$const

would also be great.

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with nits addressed

@Pierre-vh Pierre-vh requested review from tschuett and arsenm July 30, 2024 10:33
@tschuett
Copy link

lgtm

@Pierre-vh Pierre-vh merged commit 972c029 into llvm:main Aug 1, 2024
8 checks passed
@Pierre-vh Pierre-vh deleted the varargs-for-mirpats branch August 1, 2024 06:30
@tschuett
Copy link

tschuett commented Aug 1, 2024

There was no formal GitHub acceptance!

@Pierre-vh
Copy link
Contributor Author

I thought it was good given you and @arsenm said it looked good. Do you need me to revert and reopen a review?

@tschuett
Copy link

tschuett commented Aug 1, 2024

Let's leave it as is, but we both said lgtm without actual GitHub style acceptance.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-sie-ubuntu-fast running on sie-linux-worker while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/3675

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-tblgen -I /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-tblgen -I /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: �[0m�[0;1;31merror: �[0m�[1mCHECK: expected string not found in input
�[0m// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
�[0;1;32m          ^
�[0m�[1m<stdin>:16:248: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
�[0;1;32m                                                                                                                                                                                                                                                       ^
�[0m�[1m<stdin>:16:248: �[0m�[0;1;30mnote: �[0m�[1mwith "@LINE+1" equal to "31"
�[0m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
�[0;1;32m                                                                                                                                                                                                                                                       ^
�[0m�[1m<stdin>:19:139: �[0m�[0;1;30mnote: �[0m�[1mpossible intended match here
�[0m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
�[0;1;32m                                                                                                                                          ^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m            1: �[0m�[1m�[0;1;46m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td�[0m:12:5: error: 'G_BUILD_VECTOR': GIVariadic can only be used on the last operand�[0;1;46m �[0m
�[0;1;32mcheck:11'0                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;32mcheck:11'1                                                                                                                                                                                                                                 with "@LINE+1" equal to "12"
�[0m�[0;1;32mnot:imp1'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;32mnot:imp1'1                                                                                                                                                                                                                               X
�[0m�[0;1;30m            2: �[0m�[1m�[0;1;46mdef VariadicNotLastInList : GICombineRule< �[0m
�[0;1;32mnot:imp1'1     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m            3: �[0m�[1m�[0;1;46m ^ �[0m
�[0;1;32mnot:imp1'1     ~~~
�[0m�[0;1;30m            4: �[0m�[1m�[0;1;46m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td�[0m:18:5: error: 'G_IMPLICIT_DEF': GIVariadic cannot be used on defs�[0;1;46m �[0m
�[0;1;32mcheck:17'0                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;32mcheck:17'1                                                                                                                                                                                                                   with "@LINE+1" equal to "18"
�[0m�[0;1;32mnot:imp1'1     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;32mnot:imp1'2                                                                                                                                                                                                                 X
�[0m�[0;1;30m            5: �[0m�[1m�[0;1;46mdef VariadicAsDef : GICombineRule< �[0m
�[0;1;32mnot:imp1'2     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m            6: �[0m�[1m�[0;1;46m ^ �[0m
�[0;1;32mnot:imp1'2     ~~~
�[0m�[0;1;30m            7: �[0m�[1m�[0;1;46m/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td�[0m:24:5: error: conflicting types for operand 'args': 'GIVariadic<2,4>' vs 'GIVariadic<3,6>'�[0;1;46m �[0m
�[0;1;32mcheck:23'0                                                                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;32mcheck:23'1                                                                                                                                                                                                                                            with "@LINE+1" equal to "24"
�[0m�[0;1;32mnot:imp1'2     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx64-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/160/builds/2605

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/llvm-tblgen -I /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/llvm-tblgen -I /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:255: note: scanning from here
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                                              ^
<stdin>:16:255: note: with "@LINE+1" equal to "31"
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                                              ^
<stdin>:19:146: note: possible intended match here
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                                                                 ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                                                                   X error: no match found
check:30'1                                                                                                                                                                                                                                                                     with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx64-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                                                                      ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder llvm-nvptx-nvidia-ubuntu running on as-builder-7 while building llvm at step 6 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/180/builds/2604

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/llvm-tblgen -I /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/llvm-tblgen -I /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/build/bin/FileCheck /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:253: note: scanning from here
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                                            ^
<stdin>:16:253: note: with "@LINE+1" equal to "31"
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                                            ^
<stdin>:19:144: note: possible intended match here
/home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                                                               ^

Input file: <stdin>
Check file: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                                                                 X error: no match found
check:30'1                                                                                                                                                                                                                                                                   with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /home/buildbot/worker/as-builder-7/ramdisk/llvm-nvptx-nvidia-ubuntu/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                                                                    ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder clang-x86_64-debian-fast running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/56/builds/3838

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llvm-tblgen -I /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ /b/1/clang-x86_64-debian-fast/llvm.obj/bin/FileCheck /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/1/clang-x86_64-debian-fast/llvm.obj/bin/llvm-tblgen -I /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:211: note: scanning from here
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                  ^
<stdin>:16:211: note: with "@LINE+1" equal to "31"
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                  ^
<stdin>:19:102: note: possible intended match here
/b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                     ^

Input file: <stdin>
Check file: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                       X error: no match found
check:30'1                                                                                                                                                                                                                         with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/1/clang-x86_64-debian-fast/llvm.src/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                          ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/4804

Here is the relevant piece of the build log for the reference:

Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /build/buildbot/premerge-monolithic-linux/build/bin/llvm-tblgen -I /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /build/buildbot/premerge-monolithic-linux/build/bin/llvm-tblgen -I /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /build/buildbot/premerge-monolithic-linux/build/bin/FileCheck /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:227: note: scanning from here
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                  ^
<stdin>:16:227: note: with "@LINE+1" equal to "31"
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                  ^
<stdin>:19:118: note: possible intended match here
/build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                                     ^

Input file: <stdin>
Check file: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                                       X error: no match found
check:30'1                                                                                                                                                                                                                                         with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /build/buildbot/premerge-monolithic-linux/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                                          ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-rel-x86-64 running on ml-opt-rel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/185/builds/2681

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/ml-opt-rel-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/ml-opt-rel-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /b/ml-opt-rel-x86-64-b1/build/bin/FileCheck /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:209: note: scanning from here
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                ^
<stdin>:16:209: note: with "@LINE+1" equal to "31"
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                ^
<stdin>:19:100: note: possible intended match here
/b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                   ^

Input file: <stdin>
Check file: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                     X error: no match found
check:30'1                                                                                                                                                                                                                       with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/ml-opt-rel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                        ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/2661

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /b/ml-opt-devrel-x86-64-b1/build/bin/FileCheck /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:212: note: scanning from here
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                   ^
<stdin>:16:212: note: with "@LINE+1" equal to "31"
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                   ^
<stdin>:19:103: note: possible intended match here
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                      ^

Input file: <stdin>
Check file: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                        X error: no match found
check:30'1                                                                                                                                                                                                                          with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                           ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@Pierre-vh
Copy link
Contributor Author

Some patterns appear to have been renumbered after rebasing, causing the error. I fixed it in ab33c3d

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b2 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/2680

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/ml-opt-dev-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ /b/ml-opt-dev-x86-64-b1/build/bin/FileCheck /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/ml-opt-dev-x86-64-b1/build/bin/llvm-tblgen -I /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:209: note: scanning from here
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                ^
<stdin>:16:209: note: with "@LINE+1" equal to "31"
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                ^
<stdin>:19:100: note: possible intended match here
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                   ^

Input file: <stdin>
Check file: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                     X error: no match found
check:30'1                                                                                                                                                                                                                       with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                        ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-expensive-checks-debian running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/16/builds/2737

Here is the relevant piece of the build log for the reference:

Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-tblgen -I /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/llvm-tblgen -I /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
+ /b/1/llvm-clang-x86_64-expensive-checks-debian/build/bin/FileCheck /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:232: note: scanning from here
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                       ^
<stdin>:16:232: note: with "@LINE+1" equal to "31"
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                                       ^
<stdin>:19:123: note: possible intended match here
/b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                                          ^

Input file: <stdin>
Check file: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                                            X error: no match found
check:30'1                                                                                                                                                                                                                                              with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/1/llvm-clang-x86_64-expensive-checks-debian/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                                               ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 1, 2024

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 7 "test-build-unified-tree-check-llvm".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/3938

Here is the relevant piece of the build log for the reference:

Step 7 (test-build-unified-tree-check-llvm) failure: test (failure)
******************** TEST 'LLVM :: TableGen/GlobalISelCombinerEmitter/variadic-errors.td' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: not /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-tblgen -I /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner      -combiners=MyCombiner /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td 2>&1|  /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td -implicit-check-not=error:
+ not /b/1/llvm-x86_64-debian-dylib/build/bin/llvm-tblgen -I /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/../../../include -gen-global-isel-combiner -combiners=MyCombiner /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:30:11: error: CHECK: expected string not found in input
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8021:$a)'
          ^
<stdin>:16:215: note: scanning from here
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                      ^
<stdin>:16:215: note: with "@LINE+1" equal to "31"
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic
                                                                                                                                                                                                                      ^
<stdin>:19:106: note: possible intended match here
/b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)'
                                                                                                         ^

Input file: <stdin>
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
           11: def ConflictingInference : GICombineRule< 
           12:  ^ 
           13: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:24:5: note: 'args' seen with type 'GIVariadic<2,4>' in '__ConflictingInference_match_0' 
           14: def ConflictingInference : GICombineRule< 
           15:  ^ 
           16: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: cannot parse operand type: minimum number of arguments must be greater than zero in GIVariadic 
check:30'0                                                                                                                                                                                                                           X error: no match found
check:30'1                                                                                                                                                                                                                             with "@LINE+1" equal to "31"
           17: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           18:  ^ 
check:30'0     ~~~
           19: /b/1/llvm-x86_64-debian-dylib/llvm-project/llvm/test/TableGen/GlobalISelCombinerEmitter/variadic-errors.td:31:5: error: Failed to parse pattern: '(G_BUILD_VECTOR ?:$dst, anonymous_8022:$a)' 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:30'2                                                                                                              ?                                                                                     possible intended match
           20: def InvalidBounds0 : GICombineRule< 
check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  ^ 
check:30'0     ~~~
...

// CHECK: const uint8_t *GenMyCombiner::getMatchTable() const {
// CHECK-NEXT: constexpr static uint8_t MatchTable0[] = {
// CHECK-NEXT: GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2([[#LOWER:]]), GIMT_Encode2([[#UPPER:]]), /*)*//*default:*//*Label 2*/ GIMT_Encode4([[#DEFAULT:]]),
// CHECK-NEXT: GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(70), GIMT_Encode2(74), /*)*//*default:*//*Label 2*/ GIMT_Encode4(127),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change from using a "regex" to hard coding the numbers is causing the test to fail in our downstream repo. Is there a reason why we cannot update the previous test variables instead of just hard coding values in here for this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason, I just forgot that those tests were changed to use regexes and I generally update them by copy-pasting the output of tblgen. I will make a patch to fix it.

tschuett added a commit to tschuett/llvm-project that referenced this pull request Aug 10, 2024
tschuett added a commit to tschuett/llvm-project that referenced this pull request Aug 16, 2024
tschuett added a commit to tschuett/llvm-project that referenced this pull request Aug 17, 2024
tschuett added a commit to tschuett/llvm-project that referenced this pull request Aug 17, 2024
tschuett added a commit that referenced this pull request Aug 21, 2024
cjdb pushed a commit to cjdb/llvm-project that referenced this pull request Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants