llvm-project
llvm-project copied to clipboard
[SPIRV][DirectX][HLSL] Move `normalize` implementation to `hlsl_intrinsics.h`
- Remove
Intrinsic::dx_normalize - Remove
BI__builtin_hlsl_normalize - Remove
BI__builtin_hlsl_normalizeSema checks fromclang/lib/Sema/SemaHLSL.cpp - Remove
getNormalizeIntrinsicfromclang/lib/CodeGen/CGHLSLRuntime.h - Remove emitting intrinsic from
clang/lib/CodeGen/CGBuiltin.cpp - Remove
expandNormalizeIntrinsicinllvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp - Implement normalize algorithmicly in
hlsl_intrinsics.h - Add a pattern match for
normalizeas an InstCombine inllvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cppto be able to still emit thenormalizeGL extension.
@damyanp moving this to Q3.
We should move radians, step, lerp, & degrees.
may need to move sign aswell.
Update on step 8/the SPIR-V side: we will do the pattern matching approach over the spirv builtin fast path. Pattern matching will be done in the same PR, not as a follow-up.
@llvm/issue-subscribers-clang-frontend
Author: Farzon Lotfi (farzonl)
1. Remove `Intrinsic::dx_normalize`
2. Remove `BI__builtin_hlsl_normalize`
3. Remove `BI__builtin_hlsl_normalize` Sema checks from `clang/lib/Sema/SemaHLSL.cpp`
4. Remove `getNormalizeIntrinsic` from `clang/lib/CodeGen/CGHLSLRuntime.h`
5. Remove emitting intrinsic from `clang/lib/CodeGen/CGBuiltin.cpp`
6. Remove `expandNormalizeIntrinsic` in `llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp`
7. Implement normalize algorithmicly in `hlsl_intrinsics.h`
8. Add a pattern match for `normalize` as an InstCombine in `llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp` to be able to still emit the `normalize` GL extension.
@llvm/issue-subscribers-clang-codegen
Author: Farzon Lotfi (farzonl)
1. Remove `Intrinsic::dx_normalize`
2. Remove `BI__builtin_hlsl_normalize`
3. Remove `BI__builtin_hlsl_normalize` Sema checks from `clang/lib/Sema/SemaHLSL.cpp`
4. Remove `getNormalizeIntrinsic` from `clang/lib/CodeGen/CGHLSLRuntime.h`
5. Remove emitting intrinsic from `clang/lib/CodeGen/CGBuiltin.cpp`
6. Remove `expandNormalizeIntrinsic` in `llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp`
7. Implement normalize algorithmicly in `hlsl_intrinsics.h`
8. Add a pattern match for `normalize` as an InstCombine in `llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp` to be able to still emit the `normalize` GL extension.