[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
Wed Jan 31 04:03:11 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:

@vzakhari Though it's probably common to not build-test flang as well in that kind of scenario. I'm not sure I see any appropriate static getters in LLVMFuncOp that would get this information, and I don't believe I can get an instance of an LLVMFuncOp at this stage (though could be wrong - I'm new to MLIR and Flang). Could you please point to what you were imagining I could use?

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


More information about the flang-commits mailing list