Author: Farzon Lotfi Date: 2026-08-31T13:17:44-04:00 New Revision: 1b0bd3a28d1f531e643bd5f79904d6d7591dba04
URL: https://github.com/llvm/llvm-project/commit/1b0bd3a28d1f531e643bd5f79904d6d7591dba04 DIFF: https://github.com/llvm/llvm-project/commit/1b0bd3a28d1f531e643bd5f79904d6d7591dba04.diff LOG: [DirectX] Promote to an official target (#214066) This change moves the DirectX backend out of experimental and adds the clang-dxc frontend so the community has a path to trying out the new backend. The RFC that covers this change can be found here: https://discourse.llvm.org/t/rfc-promoting-the-directx-backend-to-an-official-target/91473 resolves https://github.com/llvm/wg-hlsl/issues/453 Added: Modified: clang/CMakeLists.txt clang/cmake/caches/HLSL.cmake clang/docs/ReleaseNotes.md clang/lib/Headers/CMakeLists.txt clang/tools/driver/CMakeLists.txt llvm/CMakeLists.txt llvm/docs/DirectXUsage.md llvm/docs/ReleaseNotes.md Removed: ################################################################################ diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f8d57839805cb..fc71cf45dbb34 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -527,10 +527,6 @@ option(CLANG_INCLUDE_TESTS "Generate build targets for the Clang unit tests." ${LLVM_INCLUDE_TESTS}) -option(CLANG_ENABLE_HLSL "Include HLSL build products" Off) -# While HLSL support is experimental this should stay hidden. -mark_as_advanced(CLANG_ENABLE_HLSL) - add_subdirectory(utils/TableGen) # Export CLANG_TABLEGEN_EXE for use by flang docs. diff --git a/clang/cmake/caches/HLSL.cmake b/clang/cmake/caches/HLSL.cmake index 40e92fd37382b..cf15125a8cad7 100644 --- a/clang/cmake/caches/HLSL.cmake +++ b/clang/cmake/caches/HLSL.cmake @@ -1,14 +1,10 @@ # Including the native target is important because some of LLVM's tests fail if # you don't. -set(LLVM_TARGETS_TO_BUILD "Native;SPIRV" CACHE STRING "") - -# Include the DirectX target for DXIL code generation. -set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "DirectX" CACHE STRING "") +# The DirectX target is included for DXIL code generation. +set(LLVM_TARGETS_TO_BUILD "Native;SPIRV;DirectX" CACHE STRING "") set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra" CACHE STRING "") -set(CLANG_ENABLE_HLSL On CACHE BOOL "") - if (HLSL_ENABLE_DISTRIBUTION) set(LLVM_DISTRIBUTION_COMPONENTS "clang;hlsl-resource-headers;clangd" diff --git a/clang/docs/ReleaseNotes.md b/clang/docs/ReleaseNotes.md index dd3dfdc5ad8d7..73bd144400494 100644 --- a/clang/docs/ReleaseNotes.md +++ b/clang/docs/ReleaseNotes.md @@ -619,6 +619,11 @@ features cannot lower the translation-unit ABI level; - `__builtin_amdgcn_fcmp` - `__builtin_amdgcn_fcmpf` +#### DirectX Support + +- `clang-dxc` and HLSL support are now enabled by default, following the + promotion of the DirectX backend to an official LLVM target. + #### NVPTX Support #### X86 Support diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt index 21b6eb5e38052..3d845423759ac 100644 --- a/clang/lib/Headers/CMakeLists.txt +++ b/clang/lib/Headers/CMakeLists.txt @@ -824,26 +824,19 @@ install( EXCLUDE_FROM_ALL COMPONENT gpu-resource-headers) -if(NOT CLANG_ENABLE_HLSL) - set(EXCLUDE_HLSL EXCLUDE_FROM_ALL) -endif() - install( FILES ${hlsl_h} DESTINATION ${header_install_dir} - ${EXCLUDE_HLSL} COMPONENT hlsl-resource-headers) install( FILES ${hlsl_subdir_files} DESTINATION ${header_install_dir}/hlsl - ${EXCLUDE_HLSL} COMPONENT hlsl-resource-headers) install( FILES ${hlsl_generated_files} DESTINATION ${header_install_dir}/hlsl - ${EXCLUDE_HLSL} COMPONENT hlsl-resource-headers) install( diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt index 002aaef005253..17dbb3ce8a27b 100644 --- a/clang/tools/driver/CMakeLists.txt +++ b/clang/tools/driver/CMakeLists.txt @@ -84,9 +84,7 @@ if(NOT CLANG_LINKS_TO_CREATE) set(CLANG_LINKS_TO_CREATE clang++ clang-cl clang-cpp) endif() -if (CLANG_ENABLE_HLSL) - set(HLSL_LINK clang-dxc) -endif() +set(HLSL_LINK clang-dxc) foreach(link ${CLANG_LINKS_TO_CREATE} ${HLSL_LINK}) add_clang_symlink(${link} clang) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 290b1d9f5cba5..44299d51d784a 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -581,6 +581,7 @@ set(LLVM_ALL_TARGETS ARM AVR BPF + DirectX Hexagon Lanai LoongArch @@ -601,7 +602,6 @@ set(LLVM_ALL_TARGETS set(LLVM_ALL_EXPERIMENTAL_TARGETS ARC CSKY - DirectX M68k Xtensa ) diff --git a/llvm/docs/DirectXUsage.md b/llvm/docs/DirectXUsage.md index ea9670d429e31..1141d6ef5b598 100644 --- a/llvm/docs/DirectXUsage.md +++ b/llvm/docs/DirectXUsage.md @@ -1,11 +1,5 @@ # User Guide for the DirectX Target -:::{warning} -Disclaimer: The DirectX backend is experimental and under active development. -It is not yet feature complete or ready to be used outside of experimental or -demonstration contexts. -::: - ```{toctree} :hidden: @@ -25,11 +19,10 @@ interfaces are documented in the [DirectX Specifications.](https://github.com/Mi Initially the backend is aimed at supporting DirectX 12, and support for DirectX 11 is planned at a later date. -The DirectX backend is currently experimental and is not shipped with any -release builds of LLVM tools. To build the DirectX backend locally, add -`DirectX` to the `LLVM_EXPERIMENTAL_TARGETS_TO_BUILD` CMake option. For more -information on building LLVM see the {doc}`CMake` documentation. - +The DirectX backend is an official LLVM target and is built by default as part + of `LLVM_ALL_TARGETS`. For more information on building LLVM see the + {doc}`CMake` documentation. + (dx-target-triples)= ## Target Triples diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md index e616c0581b87b..ef90a1f1f1c41 100644 --- a/llvm/docs/ReleaseNotes.md +++ b/llvm/docs/ReleaseNotes.md @@ -146,6 +146,10 @@ Makes programs 10x faster by doing Special New Thing. ### Changes to building LLVM +* The DirectX backend is now an official target and has moved from + `LLVM_ALL_EXPERIMENTAL_TARGETS` to `LLVM_ALL_TARGETS`. It is now built by + default and no longer requires `LLVM_EXPERIMENTAL_TARGETS_TO_BUILD`. + ### Changes to TableGen * `!cond` operator short-circuits at the first `true` condition. Subsequent @@ -189,6 +193,9 @@ Makes programs 10x faster by doing Special New Thing. ### Changes to the DirectX Backend +* The DirectX backend has been promoted from experimental to an official, + fully supported LLVM target. + ### Changes to the Hexagon Backend ### Changes to the LoongArch Backend _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
