Fold typed-array attribute constraints into static definition emission - #130
Merged
jonathanvdc merged 4 commits intoApr 14, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/a5fb2e4a-caaa-4ef6-98d9-14cd6d56de09 Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/a5fb2e4a-caaa-4ef6-98d9-14cd6d56de09 Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
jonathanvdc
marked this pull request as ready for review
April 14, 2026 17:44
Agent-Logs-Url: https://github.com/jonathanvdc/MLIR.NET/sessions/a5fb2e4a-caaa-4ef6-98d9-14cd6d56de09 Co-authored-by: jonathanvdc <9839946+jonathanvdc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fold typed-array attribute constraints into static definition emission
Fold typed-array attribute constraints into static definition emission
Apr 14, 2026
TableGen Interpreter BenchmarksCommit:
Interpretation:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typed-array attribute constraints were still emitted through a special generator path with per-constraint assembly-format shims. This changes them to the same static
AttributeConstraintDefinitionmodel used by other storage-backed constraints, backed by one reusable runtime typed-array assembly format.Runtime assembly format unification
TypedArrayAttributeAssemblyFormat<TElement>with a single reusable non-genericTypedArrayAttributeAssemblyFormat.[ ... ], bind viaArrayAttrConstraintHelpers.BindFromSyntax(...), print from reusableArrayAttributeValueSyntaxor rebuild fromArrayAttr.Value.Generator strategy alignment
TypedArrayConstraintCodeStrategyto emit a normal static constraint definition assembly-format expression:new global::MLIR.Dialects.Attributes.Collections.TypedArrayAttributeAssemblyFormat()Dead typed-array emission path removal
AttributeConstraintEmissionKind.TypedArray.AttributeConstraintEmitter.EmitTypedArrayConstraint(...).AttributeConstraintEmitter.GetTypedArrayElementTypeName(...)....AssemblyFormat : TypedArrayAttributeAssemblyFormat<TElement>classes.Typed property overlays preserved
AttrModeloverlay behavior for typed operation properties (csharpStorageType,csharpReturnType,csharpConvertFromStorage,csharpConstBuilderCall).IReadOnlyList<int>,IReadOnlyList<string>, etc.) viaArrayAttrConstraintHelpers.Generator test strengthened
TypedArrayAttrConstraintsAreGeneratedAsConstraintOnlyStaticClassesto assert reusable runtime typed-array format usage and absence of per-constraint typed-array assembly-format class emission.Example emitted shape now used by typed-array constraints: