[llvm] [GlobalISel][TableGen] MIR Pattern Variadics (PR #100563)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 01:13:26 PDT 2024


================
@@ -1793,11 +1806,13 @@ void InstructionMatcher::optimize() {
 
   Stash.push_back(predicates_pop_front());
   if (Stash.back().get() == &OpcMatcher) {
-    if (NumOperandsCheck && OpcMatcher.isVariadicNumOperands() &&
-        getNumOperands() != 0)
-      Stash.emplace_back(
-          new InstructionNumOperandsMatcher(InsnVarID, getNumOperands()));
-    NumOperandsCheck = false;
+    // FIXME: Is this even needed still? Why the isVariadicNumOperands check?
+    if (canAddNumOperandsCheck() && OpcMatcher.isVariadicNumOperands() &&
+        getNumOperandMatchers() != 0) {
----------------
tschuett wrote:

Are the curly braces necessary for semantics?

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


More information about the llvm-commits mailing list