[Mlir-commits] [mlir] [MLIR][LLVM] Add fast-math related function attribute support (PR #79812)

Markus Böck llvmlistbot at llvm.org
Mon Jan 29 06:26:20 PST 2024


================
@@ -1428,7 +1428,12 @@ def LLVM_LLVMFuncOp : LLVM_Op<"func", [
     OptionalAttr<LLVM_VScaleRangeAttr>:$vscale_range,
     OptionalAttr<FramePointerKindAttr>:$frame_pointer,
     OptionalAttr<StrAttr>:$target_cpu,
-    OptionalAttr<LLVM_TargetFeaturesAttr>:$target_features
+    OptionalAttr<LLVM_TargetFeaturesAttr>:$target_features,
+    OptionalAttr<BoolAttr>:$unsafe_fp_math,
+    OptionalAttr<BoolAttr>:$no_infs_fp_math,
+    OptionalAttr<BoolAttr>:$no_nans_fp_math,
+    OptionalAttr<BoolAttr>:$approx_func_fp_math,
+    OptionalAttr<BoolAttr>:$no_signed_zeros_fp_math
----------------
zero9178 wrote:

I am sadly not too familier with these attributes, and documentation seems very sparse, so I am curious whether these attributes are best modelled as `OptionalAttr<BoolAttr>` or `OptionalAttr<UnitAttr>`.

The former is tri-state between "not present", "true" and "false", but does LLVM actually differentiate between "not-present" and "false" anywhere? If not, making it a `OptionalAttr<UnitAttr>` would probably be cleaner.


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


More information about the Mlir-commits mailing list