[clang] [llvm] [HLSL] Implement the `reflect` HLSL function (PR #122992)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 16:38:57 PST 2025


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 22d4ff155aadf0f098dd5dc48d9038da15108937 782e1a28d4f8ddbeb92a9c57b3f071ba837ce129 --extensions h,cpp,c -- clang/test/CodeGenSPIRV/Builtins/reflect.c clang/test/SemaSPIRV/BuiltIns/reflect-errors.c clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Headers/hlsl/hlsl_detail.h clang/lib/Headers/hlsl/hlsl_intrinsics.h clang/lib/Sema/SemaSPIRV.cpp llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index 960c51e952..720494e45d 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -3032,11 +3032,13 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
   case Intrinsic::spv_normalize:
     return selectExtInst(ResVReg, ResType, I, CL::normalize, GL::Normalize);
   case Intrinsic::spv_reflect:
-    if (!STI.canUseExtInstSet(SPIRV::InstructionSet::InstructionSet::GLSL_std_450)) {
+    if (!STI.canUseExtInstSet(
+            SPIRV::InstructionSet::InstructionSet::GLSL_std_450)) {
       std::string DiagMsg;
       raw_string_ostream OS(DiagMsg);
       I.print(OS);
-      DiagMsg = "Intrinsic selection not supported for this instruction set: " + DiagMsg;
+      DiagMsg = "Intrinsic selection not supported for this instruction set: " +
+                DiagMsg;
       report_fatal_error(DiagMsg.c_str(), false);
     }
     return selectExtInst(ResVReg, ResType, I, GL::Reflect);

``````````

</details>


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


More information about the llvm-commits mailing list