[llvm] [LLVM][Tablegen] Add Default arguments support for Intrinsics in TableGen (PR #198557)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 06:38:27 PDT 2026
================
@@ -1278,6 +1278,36 @@ static bool convertIntrinsicValidType(StringRef Name,
return false;
}
+static bool upgradeDeclWithDefaultArgs(Function *F, Function *&NewFn) {
+ // Look up the intrinsic ID by full name, e.g. "llvm.nvvm.add3.i32"
+ Intrinsic::ID IID = Intrinsic::lookupIntrinsicID(F->getName());
+ if (IID == Intrinsic::not_intrinsic)
+ return false;
+
+ // Fast path: this intrinsic has no default args annotated in .td
+ if (!Intrinsic::hasDefaultArgs(IID))
+ return false;
+
+ if (Intrinsic::isOverloaded(IID))
----------------
jurahul wrote:
Q: can you clarify what's the issue with overloaded intrinsics? And do we check for this in TableGen side and error out (if an ImmArg for an overloaded intrinsic has default value)?
https://github.com/llvm/llvm-project/pull/198557
More information about the llvm-commits
mailing list