[clang] [HLSL][clang] Add elementwise builtins for trig intrinsics (PR #95999)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 22 12:04:43 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 6621505a1eb5428b13d2d29f377050624ef5531c bb837fd791d627fceffb73eaac70b8f4db2f4dda --extensions 'c,cpp,h' -- clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Headers/hlsl/hlsl_intrinsics.h clang/lib/Sema/SemaChecking.cpp clang/test/CodeGen/builtins-elementwise-math.c clang/test/CodeGen/strictfp-elementwise-bulitins.cpp clang/test/Sema/aarch64-sve-vector-trig-ops.c clang/test/Sema/builtins-elementwise-math.c clang/test/Sema/riscv-rvv-vector-trig-ops.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 b0cf2553dd..6316e2b062 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -3691,14 +3691,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     return RValue::get(Result);
   }
   case Builtin::BI__builtin_elementwise_acos:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::acos, "elt.acos"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::acos, "elt.acos"));
   case Builtin::BI__builtin_elementwise_asin:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::asin, "elt.asin"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::asin, "elt.asin"));
   case Builtin::BI__builtin_elementwise_atan:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::atan, "elt.atan"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::atan, "elt.atan"));
   case Builtin::BI__builtin_elementwise_ceil:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, llvm::Intrinsic::ceil, "elt.ceil"));
@@ -3725,11 +3725,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, llvm::Intrinsic::bitreverse, "elt.bitreverse"));
   case Builtin::BI__builtin_elementwise_cos:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::cos, "elt.cos"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::cos, "elt.cos"));
   case Builtin::BI__builtin_elementwise_cosh:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::cosh, "elt.cosh"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::cosh, "elt.cosh"));
   case Builtin::BI__builtin_elementwise_floor:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, llvm::Intrinsic::floor, "elt.floor"));
@@ -3746,17 +3746,17 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, llvm::Intrinsic::nearbyint, "elt.nearbyint"));
   case Builtin::BI__builtin_elementwise_sin:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::sin, "elt.sin"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::sin, "elt.sin"));
   case Builtin::BI__builtin_elementwise_sinh:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::sinh, "elt.sinh"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::sinh, "elt.sinh"));
   case Builtin::BI__builtin_elementwise_tan:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::tan, "elt.tan"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::tan, "elt.tan"));
   case Builtin::BI__builtin_elementwise_tanh:
-    return RValue::get(
-        emitBuiltinWithOneOverloadedType<1>(*this, E, llvm::Intrinsic::tanh, "elt.tanh"));
+    return RValue::get(emitBuiltinWithOneOverloadedType<1>(
+        *this, E, llvm::Intrinsic::tanh, "elt.tanh"));
   case Builtin::BI__builtin_elementwise_trunc:
     return RValue::get(emitBuiltinWithOneOverloadedType<1>(
         *this, E, llvm::Intrinsic::trunc, "elt.trunc"));

``````````

</details>


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


More information about the cfe-commits mailing list