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

Alex Bradbury via flang-commits flang-commits at lists.llvm.org
Tue Jan 30 07:52:09 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));
----------------
asb wrote:

I'm happy to go with whatever is preferred here, but I agree with @gysit that it's not clear adding such getters would be a big win. We're emitting the attribute once in our code base, and if it was typoed we'd see it fail to show up (due to being unrecognised) in the test case I added.

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


More information about the flang-commits mailing list