================
@@ -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,
+                                      mlir::NamedAttrList &attrs) {
+  addDenormalModeAttrs(CodeGenOpts.FPDenormalMode, 
CodeGenOpts.FP32DenormalMode,
+                       attrs);
+}
+
+llvm::StringLiteral
+getZeroCallUsedRegsKindStr(llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind k) {
----------------
xlauko wrote:

static?

https://github.com/llvm/llvm-project/pull/179811
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to