llvm-project
86b346da - [HLSL] For builtins aliases, apply implicit conversions before running custom type checking (#195365)

Commit
17 days ago
[HLSL] For builtins aliases, apply implicit conversions before running custom type checking (#195365) Fixes https://github.com/llvm/llvm-project/issues/195329 by making HLSL builtin aliases apply implicit conversions before running custom type checking. After this PR: - There are no more size 1 vectors being passed and returned to/from aliased Clang builtins because they get truncated to scalars due to the HLSL alias builtin not having explicit size 1 vector overloads. - HLSL alias builtins no longer accept matrices unless they have explicit matrix overloads. Matrices get implicitly truncated to scalars and resolve to the scalar Clang builtin being aliased. - Many calls with mismatched vector sizes no longer error with `arguments are of different types` and instead follow Clang's overload resolution rules with respect to HLSL's implicit conversion sequences. (e.g., `dot(float3, float2)` -> `dot(float2, float2)` with warning) - Calls with implicitly-convertible types no longer error. They are now implicitly converted, and with a warning in some cases. (e.g., `f16tof32(bool)` -> `f16tof32(uint)` without warning, but `f16tof32(short)` -> `f16tof32(uint)` with warning). Assisted-by: Claude Opus 4.6
Author
Parents
Loading