[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
Mon Feb 5 02:42:16 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:

Thanks. I've now modified to use those static helpers. They require an `mlir::OperationName` parameter, which I've had to produce manually with `mlir::OperationName("llvm.func", context);` (at this stage, func.getOperationName returns "func.func").

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


More information about the flang-commits mailing list