[llvm] [LLVM][Tablegen] Add Default arguments support for Intrinsics in TableGen (PR #198557)
Varad Rahul Kamthe via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 15 09:02:37 PDT 2026
================
@@ -130,9 +130,23 @@ class Returned<ArgIndex idx> : IntrinsicProperty {
int ArgNo = idx.Value;
}
-// ImmArg - The specified argument must be an immediate.
-class ImmArg<ArgIndex idx> : IntrinsicProperty {
+// DefaultValue - A value carrier paired with ImmArg to declare a default for
+// a missing trailing argument. AutoUpgrade fills the default when an old
+// .bc / .ll file is loaded.
+class DefaultValue<int val> {
+ int Value = val;
+}
+
+// Sentinel — used as the default for ImmArg's optional DefaultValue parameter.
+def NoDefault : DefaultValue<0> {
+ let Value = ?;
+}
+
+// ImmArg - The specified argument must be an immediate. The optional
+// second template parameter declares a default value for AutoUpgrade.
----------------
varadk27 wrote:
Updated in the latest revision. Thanks!
https://github.com/llvm/llvm-project/pull/198557
More information about the llvm-commits
mailing list