[flang-commits] [flang] [flang][evaluate] Fold SIND() by rewriting to SIN(x * pi/180) (PR #194527)

via flang-commits flang-commits at lists.llvm.org
Mon Apr 27 20:54:30 PDT 2026


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 origin/main HEAD --extensions cpp -- flang/lib/Evaluate/fold-real.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/flang/lib/Evaluate/fold-real.cpp b/flang/lib/Evaluate/fold-real.cpp
index 49f624e80..9826fe0f5 100644
--- a/flang/lib/Evaluate/fold-real.cpp
+++ b/flang/lib/Evaluate/fold-real.cpp
@@ -421,8 +421,7 @@ Expr<Type<TypeCategory::Real, KIND>> FoldIntrinsicFunction(
       Scalar<T> pi{Scalar<T>::Read(piStr).value};
       Scalar<T> oneEighty{Scalar<T>::Read(oneEightyStr).value};
       Scalar<T> piOver180{pi.Divide(oneEighty).value};
-      *xExpr = std::move(*xExpr) *
-          Expr<T>{Constant<T>{std::move(piOver180)}};
+      *xExpr = std::move(*xExpr) * Expr<T>{Constant<T>{std::move(piOver180)}};
       intrinsic->name = "sin";
       return FoldIntrinsicFunction<KIND>(context, std::move(funcRef));
     }

``````````

</details>


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


More information about the flang-commits mailing list