<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/128043>128043</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIRV][DirectX][HLSL] Move `normalize` implementation to `hlsl_intrinsics.h`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:DirectX,
HLSL,
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
farzonl
</td>
</tr>
</table>
<pre>
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 extention.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVE9voz4U_DTmYhUZgyE9cEiaX_qLlF1V7arqLTLwAG_9B9mmSvvpVyYJya66q55si-eZNzN-cOdEpwFKxFaIrSM--t7YsuX2w2gZVaZ5L5MYP4Iyb4BRTrbaW6GdqFG6ROmyOey1sYpL8QEoJ4gs6XX1arvfV6OQXuh9L538szj9cjF-AsVx3UP96nBrjQo3asl1h-hGigrRTag4Lf_vnnZxPQxHluyapQP__Yx7EZOTv4DemQbuQYfdfUB9HLUXCuL-CM1maFDCe6E7LM6gX0BcHeVeWs2vW4XDwHXzebdChwop39QM_IPbDjyim7WwUPuXsHvZ7uZr_wU4J8wVXRFjvFWDBAXa49lvzGVnrPC9ErV8D1xTHrMyd5a_iDHmTYM5Hrj3YDVW3Nc9bo29RnOYa7zVzt8ZVQkN_-z-6WH7-HxeHyzsoJtg7OmyPbWPvcEVYF5JCFvnhZRTCtj3cMV-v8Nw8KB9UB41Zdrcprc8gjIpMkKKnGZp1Jc157S6TRPGi6RJgFXFoi044y3LWJs3LBIlJZQRSkmySElGY8hZUvMiJU3VMpIwlBFQXMg4yIqN7SLh3AhlQhckSyPJK5BumjNKK16_gm5QupyzoojeIUrDG5sPl7Jgxs1z-MDWkS0DxU01dg5lRArn3YXUCy-ncT76yNaIrc4k02FiYGv87fTKfpsycX4MPNgVfEU5-Sz8aLSy7L0fXPgR0A2im074fqzi2kyhnrINjQ7W_IQ6ZDs54hDdnEx5K-mvAAAA___IWni0">