[clang] [HLSL][Matrix] Add Matrix Bool and represent them as i32 elements (PR #171051)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 11 09:57:08 PST 2025


================
@@ -106,7 +106,7 @@ float test_builtin_dot_int_vect_to_float_vec_promotion(int2 p0, float p1) {
 
 int test_builtin_dot_bool_type_promotion(bool p0, float p1) {
   return __builtin_hlsl_dot(p0, p1);
-  // expected-error at -1 {{1st argument must be a vector, integer or floating-point type (was 'bool')}}
+  // expected-error at -1 {{arguments are of different types ('bool' vs 'float')}}
 }
----------------
farzonl wrote:

I thought about it a bit more and I don't like the coupling of `MatrixType::isValidElementType`  and `checkMathBuiltinElementType`  and instead made an `isValidMathElementType`.  I'll forward the clamp issue to @spall and see what she thinks? But for now maybe its better to not change any behavior.

https://github.com/llvm/llvm-project/pull/171051


More information about the cfe-commits mailing list