Skip to content

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

Out << "$ui8_4pk@";
break;
case BuiltinType::LinAlgMatrix:
Out << "$linalg_matrix@";
Copy link
Contributor

Choose a reason for hiding this comment

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

As before, don't we need to capture matrix properties into mangling?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is mangling of just the base built-in type, which can be spell out in the code, although the __builtin prefix should discourage people from doing that. The attributes are added in a separate PR.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Implement new builtin type for LinAlg Matrix handle

4 participants