[clang] [Matrix] Implement matrix support for the `lerp` intrinsic (PR #243639)

Kaitlin Peng via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 18 12:47:20 PST 2026


================
@@ -1231,7 +1231,6 @@ can equivalently be written as x + s(y-x).
   let ParamNames = ["x", "y", "s"];
   let VaryingTypes = [HalfTy, FloatTy];
   let VaryingLongVector = 1;
-  let VaryingMatDims = [];
----------------
kmpeng wrote:

This doesn't have to do with `float`. `lerp` is an `HLSLThreeArgDetail`, which already defaults to `AllMatDims`, so deleting the `[]` override is enough to enable matrix support. `ldexp` is a plain `HLSLBuiltin`, so it has to set `AllMatDims` explicitly.
This is actually how most other intrinsics enable matrix support. `ldexp` is the one that's different.

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


More information about the cfe-commits mailing list