Skip to content

Implement Matrix Annotate Builtin + Create dx.types.MatrixProperties #7896

@V-FEXrt

Description

@V-FEXrt

Note: This issue is only for creating the annotate builtin in. Not for covering how/where it should be used nor for deduplicating annotations.

Create the type %dx.types.MatrixProperties as defined in the spec.

Open question:

  • Is there value in making MatrixProperties an HLSL type? My feeling is no, but if yes then the complexity of this ticket is notably higher. Everything below assumes no and this should be rewritten otherwise.

Create __builtin_la_matrix_annotate(MatrixRef, ComponentType, M, N, MatrixUse, MatrixScope) and lower it to dx.op.annotateMatrix as specified in https://github.com/microsoft/hlsl-specs/blob/main/proposals/0035-linalg-matrix.md

Changes required:

  • Define the %dx.types.MatrixProperties type similarly to how [SM6.10][LinAlg] Impl MatrixRef, CreateMatrix builtins #7883 does
  • Define the new intrinsic in utils/hct/gen_intrin_main.txt
  • Update lib/HLSL/HLOperationLower.cpp with new op mapping and TranslateLAAnnontateMatrix lowering function
  • Write frontend tests in tools/clang/test/SemaHLSL/hlsl/objects/MatrixRef
  • Define the new opcode in utils/hct/hctdb.py
  • Write codegen tests in tools/clang/test/CodeGenDXIL/hlsl/
    • There are three different subdirs that the tests could go in linalg, intrinsics, or objects. That decision is left up to the implementer

Note: The spec is not final therefore this issue may fall out of date. The spec is the source of truth and should be referenced during implementation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions