llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[SPIRV][DirectX][HLSL] Move `step` implementation to `hlsl_intrinsics.h`

Open farzonl opened this issue 4 months ago • 2 comments

  1. Remove Intrinsic::dx_step and Intrinsic::spv_step
  2. Remove BI__builtin_hlsl_step
  3. Remove BI__builtin_hlsl_step Sema checks from clang/lib/Sema/SemaHLSL.cpp
  4. Remove getStepIntrinsic from clang/lib/CodeGen/CGHLSLRuntime.h
  5. Remove emitting intrinsic from clang/lib/CodeGen/CGBuiltin.cpp
  6. Remove expandStepIntrinsic in llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp
  7. Implement step algorithm in hlsl_intrinsics.h via tablegen
  8. (Follow-up) add a pattern match for step as an InstCombine in llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp to be able to still emit the step GL extension.

farzonl avatar Jul 30 '26 18:07 farzonl

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.

farzonl avatar Jul 30 '26 18:07 farzonl

Pattern matching will be a separate follow-up issue: #214862

kmpeng avatar Aug 07 '26 01:08 kmpeng