[Mlir-commits] [mlir] [mlir][func] Account for named attributes without a dialect prefix in `FuncToLLVM` lowering pass (PR #182987)
Ayokunle Amodu
llvmlistbot at llvm.org
Tue Feb 24 18:51:28 PST 2026
================
@@ -52,10 +52,15 @@ static constexpr StringRef varargsAttrName = "func.varargs";
static constexpr StringRef linkageAttrName = "llvm.linkage";
static constexpr StringRef barePtrAttrName = "llvm.bareptr";
+static constexpr StringRef varargsAttrNameNoPrefix = "varargs";
+static constexpr StringRef linkageAttrNameNoPrefix = "linkage";
+static constexpr StringRef barePtrAttrNameNoPrefix = "bareptr";
+
/// Return `true` if the `op` should use bare pointer calling convention.
static bool shouldUseBarePtrCallConv(Operation *op,
const LLVMTypeConverter *typeConverter) {
- return (op && op->hasAttr(barePtrAttrName)) ||
+ return (op && (op->hasAttr(barePtrAttrName) ||
+ op->hasAttr(barePtrAttrNameNoPrefix))) ||
----------------
ayokunle321 wrote:
Thank you guys for the review! I had thought the attribute names without dialect prefixes would still be recognized as their dialect-prefixed counterparts. And yes, the hard-coded strings are the roots of evil. So do we leave it as is or try with `getAttributeNames()`?
https://github.com/llvm/llvm-project/pull/182987
More information about the Mlir-commits
mailing list