[llvm] [TableGen] Added submulticlass typechecking to template arg values. (PR #112904)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 07:40:29 PDT 2024


================
@@ -37,7 +37,7 @@ defvar VOPDX_Max_Index = 12;
 
 class VOPD_Component<bits<5> OpIn, string vOPDName> {
   Instruction BaseVOP = !cast<Instruction>(NAME);
-  string VOPDName = "v_dual_" # !substr(vOPDName, 2);
+  string VOPDName = "v_dual_" # !if(!le(!size(vOPDName), 2), "", !substr(vOPDName, 2));
----------------
jofrn wrote:

A def within a multiclass inherits from `VOPD_Component`. This multiclass itself is a submulticlass, so `CheckTemplateArgValues` will be invoked on it.

`vOPDName` is passed as an empty string into here from `multiclass VOP2eInst`, and the typechecking caught this.

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


More information about the llvm-commits mailing list