[flang-commits] [flang] [mlir] [flang] Set fast math related function attributes for -Ofast/-ffast-math (PR #79301)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Mon Jan 29 18:01:06 PST 2024


================
@@ -45,14 +50,32 @@ void FunctionAttrPass::runOnOperation() {
     func->setAttr("frame_pointer", mlir::LLVM::FramePointerKindAttr::get(
                                        context, framePointerKind));
 
+  if (noInfsFPMath)
+    func->setAttr("no_infs_fp_math", mlir::BoolAttr::get(context, true));
----------------
vzakhari wrote:

I am not a fan of using literal constants while they have to be kept in sync between multiple components.  Is it reasonable to make them named attributes in LLVM dialect and provide the name getters for them in `LLVMDialect.td`?

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


More information about the flang-commits mailing list