[all-commits] [llvm/llvm-project] 76f194: [HLSL] Implement the `fwidth` intrinsic for DXIL a...

Alexander Johnston via All-commits all-commits at lists.llvm.org
Thu Nov 20 04:38:53 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76f1949cfa0d8fed73c153af83a7054073686506
      https://github.com/llvm/llvm-project/commit/76f1949cfa0d8fed73c153af83a7054073686506
  Author: Alexander Johnston <alexander.javen.johnston at gmail.com>
  Date:   2025-11-20 (Thu, 20 Nov 2025)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsSPIRVVK.td
    M clang/lib/CodeGen/TargetBuiltins/SPIR.cpp
    M clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h
    M clang/lib/Headers/hlsl/hlsl_intrinsics.h
    M clang/lib/Sema/SemaSPIRV.cpp
    A clang/test/CodeGenHLSL/builtins/fwidth.hlsl
    A clang/test/CodeGenSPIRV/Builtins/fwidth.c
    A clang/test/SemaSPIRV/BuiltIns/fwidth-errors.c
    M llvm/include/llvm/IR/IntrinsicsSPIRV.td
    M llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
    M llvm/test/CodeGen/DirectX/ddx_coarse-errors.ll
    M llvm/test/CodeGen/DirectX/ddy_coarse-errors.ll
    A llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fwidth.ll
    A llvm/test/CodeGen/SPIRV/opencl/fwidth-error.ll

  Log Message:
  -----------
  [HLSL] Implement the `fwidth` intrinsic for DXIL and SPIR-V target (#161378)

Adds the fwidth intrinsic for HLSL.
The DXIL path only requires modification to the hlsl headers.
The SPIRV path implements the OpFwidth builtin in Clang and instruction
selection for the OpFwidth instruction in LLVM.
Also adds shader stage tests to the ddx_coarse and ddy_coarse
instructions used by fwidth.

Closes #99120

---------

Co-authored-by: Alexander Johnston <alexander.johnston at amd.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list