[llvm] MachineVerifier: Reject extra non-register operands on instructions (PR #73758)

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 06:25:54 PST 2023


================
@@ -1175,19 +1175,10 @@ bool MIParser::parse(MachineInstr *&MI) {
   MI = MF.CreateMachineInstr(MCID, DebugLocation, /*NoImplicit=*/true);
   MI->setFlags(Flags);
 
-  unsigned NumExplicitOps = 0;
-  for (const auto &Operand : Operands) {
-    bool IsImplicitOp = Operand.Operand.isReg() && Operand.Operand.isImplicit();
-    if (!IsImplicitOp) {
-      if (!MCID.isVariadic() && NumExplicitOps >= MCID.getNumOperands() &&
-          !Operand.Operand.isValidExcessOperand())
-        return error(Operand.Begin, "too many operands for instruction");
-
-      ++NumExplicitOps;
-    }
-
+  // Don't check the operands make sense, let the verifier catch any
----------------
kparzysz wrote:

I think there is "if" missing in the comment.

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


More information about the llvm-commits mailing list