[SPIRV][DirectX][HLSL] Move `degrees` implementation to `hlsl_intrinsics.h`
- Remove
Intrinsic::dx_degreesandIntrinsic::spv_degrees - Remove
BI__builtin_hlsl_degrees - Remove
BI__builtin_hlsl_degreesSema checks fromclang/lib/Sema/SemaHLSL.cpp - Remove
getDegreesIntrinsicfromclang/lib/CodeGen/CGHLSLRuntime.h - Remove emitting intrinsic from
clang/lib/CodeGen/CGBuiltin.cpp - Remove
expandDegreesIntrinsicinllvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp - Implement degrees algorithm in
hlsl_intrinsics.hvia tablegen - (Follow-up) add a pattern match for degrees as an InstCombine in
llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cppto be able to still emit the degrees GL extension.
For any future implementer I would like the pattern matching to be a separate pr from the movement to the code from the backends to the HLSL header.
Pattern matching will be a separate follow-up issue: https://github.com/llvm/llvm-project/issues/214882
@llvm/issue-subscribers-clang-codegen
Author: Farzon Lotfi (farzonl)
@llvm/issue-subscribers-clang-frontend
Author: Farzon Lotfi (farzonl)
4. For any future implementer I would like the pattern matching to be a separate pr from the movement to the code from the backends to the HLSL header.
But why? Like this you are forcing yourself to fight windmills in case if middle end changes the desired pattern. You are also inherently losing debug information as pattern matcher runs with -O0. If you have a target-specific instruction it's normal practice to expose it in IR via an intrinsic wiring up with the frontend via builtin.
22. > 4. For any future implementer I would like the pattern matching to be a separate pr from the movement to the code from the backends to the HLSL header.
But why? Like this you are forcing yourself to fight windmills in case if middle end changes the desired pattern. You are also inherently losing debug information as pattern matcher runs with -O0. If you have a target-specific instruction it's normal practice to expose it in IR via an intrinsic wiring up with the frontend via builtin.
We were using builtin. The feedback we recieved was not to I responded to you here about that feedback. https://github.com/llvm/llvm-project/pull/237935#discussion_r4445546546 This was the RFC: https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329
We were using builtin. The feedback we recieved was not to I responded to you here about that feedback. [#237935 (comment)](https://github.com/llvm/llvm-project/pull/237935#discussion_r4445546546) This was the RFC: https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329
Thank you, now I have the full context. I'll reply back in the PR's thread, when I come up with (probably) acceptable suggestions.