[Mlir-commits] [mlir] [MLIR][LLVM] Add ftz and fuse FP ops related function attribute support (PR #97812)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Jul 8 02:35:48 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c119da23afb42daf588c3e4caf97094689d70688 8af308feef2237d7a8183a4192a0b84d0b8914bf -- mlir/lib/Target/LLVMIR/ModuleImport.cpp mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
index 762221d98e..0c8b3296f4 100644
--- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
@@ -1829,11 +1829,13 @@ void ModuleImport::processFunctionAttributes(llvm::Function *func,
 
   if (llvm::Attribute attr = func->getFnAttribute("denormal-fp-math");
       attr.isStringAttribute())
-    funcOp.setDenormalFpMathAttr(StringAttr::get(context, attr.getValueAsString()));
+    funcOp.setDenormalFpMathAttr(
+        StringAttr::get(context, attr.getValueAsString()));
 
   if (llvm::Attribute attr = func->getFnAttribute("denormal-fp-math-f32");
       attr.isStringAttribute())
-    funcOp.setDenormalFpMathF32Attr(StringAttr::get(context, attr.getValueAsString()));
+    funcOp.setDenormalFpMathF32Attr(
+        StringAttr::get(context, attr.getValueAsString()));
 
   if (llvm::Attribute attr = func->getFnAttribute("fp-contract");
       attr.isStringAttribute())
diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index f482c51329..bc0f709fc2 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -1352,16 +1352,13 @@ LogicalResult ModuleTranslation::convertOneFunction(LLVMFuncOp func) {
                         llvm::toStringRef(*noSignedZerosFpMath));
 
   if (auto denormalFpMath = func.getDenormalFpMath())
-    llvmFunc->addFnAttr("denormal-fp-math",
-                        *denormalFpMath);
+    llvmFunc->addFnAttr("denormal-fp-math", *denormalFpMath);
 
   if (auto denormalFpMathF32 = func.getDenormalFpMathF32())
-    llvmFunc->addFnAttr("denormal-fp-math-f32",
-                        *denormalFpMathF32);
+    llvmFunc->addFnAttr("denormal-fp-math-f32", *denormalFpMathF32);
 
   if (auto fpContract = func.getFpContract())
-    llvmFunc->addFnAttr("fp-contract",
-                        *fpContract);
+    llvmFunc->addFnAttr("fp-contract", *fpContract);
 
   // Add function attribute frame-pointer, if found.
   if (FramePointerKindAttr attr = func.getFramePointerAttr())

``````````

</details>


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


More information about the Mlir-commits mailing list