[llvm] [InstCombine] Optimise x / sqrt(y / z) with fast-math pattern. (PR #76737)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 03:25:52 PST 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 9d3fbf97bef3f19da4e0a047f017b8142f59b3fd 2a601a01193951850292a348dd7f1a174249b119 -- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 983d7f9563..cfe77da9b4 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1716,7 +1716,8 @@ static Instruction *foldFDivSqrtDivisor(BinaryOperator &I,
 
   Value *Y, *Z;
   auto *DivOp = dyn_cast<Instruction>(II->getOperand(0));
-  if (!DivOp || !DivOp->hasAllowReassoc() || !I.hasAllowReciprocal() || !DivOp->hasOneUse())
+  if (!DivOp || !DivOp->hasAllowReassoc() || !I.hasAllowReciprocal() ||
+      !DivOp->hasOneUse())
       !I.hasAllowReciprocal())
     return nullptr;
   if (match(DivOp, m_FDiv(m_Value(Y), m_Value(Z)))) {

``````````

</details>


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


More information about the llvm-commits mailing list