[all-commits] [llvm/llvm-project] 88af28: [HLSL] Rewrite inline HLSL intrinsics into TableGe...
Deric C. via All-commits
all-commits at lists.llvm.org
Tue Apr 7 13:31:01 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 88af28072637213c32cd53c99c4b9d79ded6e746
https://github.com/llvm/llvm-project/commit/88af28072637213c32cd53c99c4b9d79ded6e746
Author: Deric C. <cheung.deric at gmail.com>
Date: 2026-04-07 (Tue, 07 Apr 2026)
Changed paths:
M clang/include/clang/Basic/HLSLIntrinsics.td
M clang/lib/Headers/hlsl/hlsl_alias_intrinsics.h
M clang/lib/Headers/hlsl/hlsl_detail.h
M clang/lib/Headers/hlsl/hlsl_intrinsic_helpers.h
M clang/lib/Headers/hlsl/hlsl_intrinsics.h
M clang/test/CodeGenHLSL/builtins/dst.hlsl
M clang/test/CodeGenHLSL/builtins/ldexp.hlsl
M clang/test/CodeGenHLSL/resources/NonUniformResourceIndex.hlsl
M clang/test/SemaHLSL/BuiltIns/D3DCOLORtoUBYTE4-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/dot2add-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/faceforward-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/fmod-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/ldexp-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/refract-errors.hlsl
M clang/test/SemaHLSL/BuiltIns/smoothstep-errors.hlsl
Log Message:
-----------
[HLSL] Rewrite inline HLSL intrinsics into TableGen (#188362)
Partially addresses https://github.com/llvm/llvm-project/issues/188345.
This PR rewrites all applicable inline HLSL intrinsics from
`hlsl_intrinsics.h` into TableGen.
The unsigned `abs` from `hlsl_alias_intrinsics.h` is also rewritten into
TableGen since it can also be defined inline.
The `NonUniformResourceIndex` is moved from `hlsl_intrinsics.h` over to
`hlsl_alias_intrinsics.h` since it can be defined as an alias.
`__detail::.*_impl` helper functions that were one liners have been
removed, and their corresponding HLSL intrinsics have been defined in
TableGen using the `Body` field instead.
Note that rewriting `refract` in TableGen instead of templates
introduces some significant changes to error messages and also
introduces a new offload test suite failure in the fp16 test because a
call to `refract(x, y, 0.5)` where x and y are half-typed vectors is
ambiguous due to 0.5 being a 32-bit float literal.
The generated `hlsl_inline_intrinsics_gen.inc` file looks like this:
https://gist.github.com/Icohedron/a1c4a47ad0bb184f857430835d7d2ca3
Assisted-by: GitHub Copilot
---------
Co-authored-by: Justin Bogner <mail at justinbogner.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