Skip to content

[SM6.10] Add built-in type for LinAlg Matrix handle#8090

Merged
hekota merged 10 commits intomicrosoft:mainfrom
hekota:matrix-builtin-handle-type
Feb 5, 2026
Merged

[SM6.10] Add built-in type for LinAlg Matrix handle#8090
hekota merged 10 commits intomicrosoft:mainfrom
hekota:matrix-builtin-handle-type

Conversation

@hekota
Copy link
Member

@hekota hekota commented Jan 22, 2026

Adds a built-in type __builtin_LinAlgMatrix that will be used in LinAlg Matrix implementation for SM 6.10.

Closes #8121

Adds a built-in type `__builtin_LinAlg_Matrix` that will be used in LinAlg Matrix implementation.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you probably want an approval from someone more knowledgeable.

@hekota hekota requested a review from llvm-beanz February 2, 2026 18:15
@V-FEXrt
Copy link
Collaborator

V-FEXrt commented Feb 2, 2026

About to start a deeper review but wanted to get this out there as quickly as possible.

How do you feel about __builtin_LinAlgMatrix instead of __builtin_LinAlg_Matrix?

Looking back on chat history it looks like I +1'd __builtin_LinAlg_Matrix but I must have missed the extra underscore somehow since I was surprised to see it there when I started looking at this PR.

My thoughts on why are below:

  • I don't see the type as "Matrix" under the "LinAlg" feature but instead a singular noun "LinAlgMatrix" as opposed to some other noun like "CoopVecMatrix" or "GenericMatrix"
  • Selfishly, I've written a lot of code using __builtin_LinAlgMatrix that would not be very fun to update

If you are okay with the change I'm more than happy to do the chore work of renaming everything

case BuiltinType::OCLSampler: ID = PREDEF_TYPE_SAMPLER_ID; break;
case BuiltinType::OCLEvent: ID = PREDEF_TYPE_EVENT_ID; break;
case BuiltinType::LinAlgMatrix:
ID = PREDEF_TYPE_LINALG_MATRIX_ID;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, but we never supported AST serialization in this code base, and there are many missing pieces already. That's why we never added the other HLSL types here.

Copy link
Collaborator

@V-FEXrt V-FEXrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM*, like Damyan I'm going to leave someone else to approve since this shape of adding a type is very new looking to me :)

*of course I'd like to discuss the time name as mentioned above

@hekota
Copy link
Member Author

hekota commented Feb 2, 2026

How do you feel about __builtin_LinAlgMatrix instead of __builtin_LinAlg_Matrix?

  • I don't see the type as "Matrix" under the "LinAlg" feature but instead a singular noun "LinAlgMatrix" as opposed to some other noun like "CoopVecMatrix" or "GenericMatrix"

I agree, __builtin_LinAlgMatrix is a better name.

Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @tex3d pointed out the AST bitcode serialization is effectively untestable because it's all totally broken, but the change looks good and reasonable to me.

@hekota hekota merged commit 7936ebc into microsoft:main Feb 5, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Implement new builtin type for LinAlg Matrix handle

5 participants