[clang] [mlir] [CIR] Add tons of function infra, plus a handful of attributes (PR #179811)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 5 09:54:45 PST 2026


================
@@ -145,6 +145,169 @@ static void addNoBuiltinAttributes(mlir::MLIRContext &ctx,
               mlir::ArrayAttr::get(&ctx, nbFuncs.getArrayRef()));
 }
 
+/// Add denormal-fp-math and denormal-fp-math-f32 as appropriate for the
+/// requested denormal behavior, accounting for the overriding behavior of the
+/// -f32 case.
+static void addDenormalModeAttrs(llvm::DenormalMode fpDenormalMode,
+                                 llvm::DenormalMode fp32DenormalMode,
+                                 mlir::NamedAttrList &attrs) {
+  // TODO(cir): Classic-codegen sets the denormal modes here. There are two
+  // values, both with a string, but it seems that perhaps we could combine
+  // these into a single attribute?  It seems a little silly to have two so
+  // similar named attributes that do the same thing.
+}
+
+/// Add default attributes to a function, which have merge semantics under
+/// -mlink-builtin-bitcode and should not simply overwrite any existing
+/// attributes in the linked library.
+static void
+addMergeableDefaultFunctionAttributes(const CodeGenOptions &CodeGenOpts,
----------------
andykaylor wrote:

```suggestion
addMergeableDefaultFunctionAttributes(const CodeGenOptions &codeGenOpts,
```

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


More information about the cfe-commits mailing list