llvm-project
llvm-project copied to clipboard
[SPIRV][DirectX][HLSL] Move `radians` implementation to `hlsl_intrinsics.h`
- Remove
Intrinsic::dx_ radiansandIntrinsic::spv_radians - Remove
BI__builtin_hlsl_ radians - Remove
BI__builtin_hlsl_ radiansSema checks fromclang/lib/Sema/SemaHLSL.cpp - Remove
getRadiansIntrinsicfromclang/lib/CodeGen/CGHLSLRuntime.h - Remove emitting intrinsic from
clang/lib/CodeGen/CGBuiltin.cpp - Remove
expandRadiansIntrinsicinllvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp - Implement radians algorithm in
hlsl_intrinsics.hvia tablegen - (Follow-up) add a pattern match for radians as an InstCombine in
llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cppto be able to still emit the radians 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/214880
@llvm/issue-subscribers-clang-codegen
Author: Farzon Lotfi (farzonl)
1. Remove `Intrinsic::dx_ radians ` and `Intrinsic::spv_radians `
2. Remove `BI__builtin_hlsl_ radians `
3. Remove `BI__builtin_hlsl_ radians ` Sema checks from `clang/lib/Sema/SemaHLSL.cpp`
4. Remove `getRadiansIntrinsic` from `clang/lib/CodeGen/CGHLSLRuntime.h`
5. Remove emitting intrinsic from `clang/lib/CodeGen/CGBuiltin.cpp`
6. Remove `expandRadiansIntrinsic` in `llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp`
7. Implement radians algorithm in `hlsl_intrinsics.h` via tablegen
8. (Follow-up) add a pattern match for radians as an InstCombine in `llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp` to be able to still emit the radians GL extension.
@llvm/issue-subscribers-clang-frontend
Author: Farzon Lotfi (farzonl)
1. Remove `Intrinsic::dx_ radians ` and `Intrinsic::spv_radians `
2. Remove `BI__builtin_hlsl_ radians `
3. Remove `BI__builtin_hlsl_ radians ` Sema checks from `clang/lib/Sema/SemaHLSL.cpp`
4. Remove `getRadiansIntrinsic` from `clang/lib/CodeGen/CGHLSLRuntime.h`
5. Remove emitting intrinsic from `clang/lib/CodeGen/CGBuiltin.cpp`
6. Remove `expandRadiansIntrinsic` in `llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp`
7. Implement radians algorithm in `hlsl_intrinsics.h` via tablegen
8. (Follow-up) add a pattern match for radians as an InstCombine in `llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp` to be able to still emit the radians GL extension.