[clang] [Clang] Add __builtin_(elementwise|reduce)_(max|min)imum (PR #110198)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 19:41:28 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 fbec6754d6d643762738fe4428e3faf6bae51a7d bc5f9d098761bb5078c11ebd55f8ca443633baa4 --extensions cpp,c -- clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Sema/SemaChecking.cpp clang/test/CodeGen/builtins-elementwise-math.c clang/test/CodeGen/builtins-reduction-math.c clang/test/CodeGen/strictfp-elementwise-bulitins.cpp clang/test/Sema/builtins-elementwise-math.c clang/test/Sema/builtins-reduction-math.c clang/test/SemaCXX/builtins-elementwise-math.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 0ab8068bb9..cbc51ebbe9 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -3963,16 +3963,16 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
   case Builtin::BI__builtin_elementwise_maximum: {
     Value *Op0 = EmitScalarExpr(E->getArg(0));
     Value *Op1 = EmitScalarExpr(E->getArg(1));
-    Value *Result = Builder.CreateBinaryIntrinsic(
-        llvm::Intrinsic::maximum, Op0, Op1, nullptr, "elt.maximum");
+    Value *Result = Builder.CreateBinaryIntrinsic(llvm::Intrinsic::maximum, Op0,
+                                                  Op1, nullptr, "elt.maximum");
     return RValue::get(Result);
   }
 
   case Builtin::BI__builtin_elementwise_minimum: {
     Value *Op0 = EmitScalarExpr(E->getArg(0));
     Value *Op1 = EmitScalarExpr(E->getArg(1));
-    Value *Result = Builder.CreateBinaryIntrinsic(
-        llvm::Intrinsic::minimum, Op0, Op1, nullptr, "elt.minimum");
+    Value *Result = Builder.CreateBinaryIntrinsic(llvm::Intrinsic::minimum, Op0,
+                                                  Op1, nullptr, "elt.minimum");
     return RValue::get(Result);
   }
 

``````````

</details>


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


More information about the cfe-commits mailing list