Skip to content

Conversation

@hekota
Copy link
Member

@hekota hekota commented Feb 4, 2026

Adds codegen for Attributed LinAlgMatrix types. Each type is translated into its corresponding DXIL type %dx.types.LinAlgMatrix<mangling> where <mangling> encodes the matrix attributes.

For example this type:

__builtin_LinAlgMatrix [[__LinAlgMatrix_Attributes(ComponentType::I32, 4, 5, MatrixUse::B, MatrixScope::ThreadGroup)]]

Will be traslated to %dx.types.LinAlgMatrixC4M4N5U1S2.

Also adds !dx.targetTypes metadata node that lists all LinAlgMatrix types that were ever used in the module. For the example above that would be:

!dx.targetTypes = !{!1}
!1 ! = = !{%dx.types.LinAlgMatrixC4M4N5U1S2 undef, i32 4, i32 4, i32 5, i32 1, i32 2}

Later after optimizations these metadata nodes should be pruned to contain only the types actually used in the module (task #8133).

Fixes #8123
Fixes #8127

@hekota hekota marked this pull request as ready for review February 4, 2026 01:47
@hekota hekota changed the title Codegen for attributed LinAlg Matrix types [SM6.10] Codegen for attributed LinAlg Matrix types Feb 4, 2026
@hekota hekota requested a review from llvm-beanz February 4, 2026 01:56
@hekota hekota linked an issue Feb 4, 2026 that may be closed by this pull request
Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

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

Main point: "TargetTypes" sounds more general than this appears to be. Should we make the metadata more general with a class identifier, or change the name to be more specific?

V-FEXrt
V-FEXrt previously approved these changes Feb 9, 2026
tex3d
tex3d previously approved these changes Feb 11, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r 57a71b0cc5837c5989038734b12076655285918d..f666744dd794a60982e6ef8a47be1031e8a2c830 utils/hct/hctdb.py
View the diff from darker here.
--- hctdb.py	2026-02-11 21:19:12.000000 +0000
+++ hctdb.py	2026-02-12 06:46:13.438004 +0000
@@ -1181,11 +1181,11 @@
             i.shader_stages = (
                 "compute",
                 "mesh",
                 "amplification",
             )
-    
+
         for i in insts("DebugBreak", "IsDebuggerPresent"):
             i.category = "Debugging"
             i.shader_model = experimental_sm
 
     def populate_llvm_instructions(self):
  • Check this box to apply formatting changes to this branch.

@hekota hekota changed the base branch from users/hekota/pr8125-linalg-matrix-attributes-and-types to main February 12, 2026 06:46
@hekota hekota dismissed stale reviews from tex3d and V-FEXrt February 12, 2026 06:46

The base branch was changed.

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.

Emit metadata table for mangled LinAlgMatrix types CodeGen for attributed matrix handles

4 participants