[eudsl-python-extras] support types as GenericAlias for input arg annotations#356
Merged
Merged
Conversation
makslevental
commented
Mar 8, 2026
Comment on lines
+851
to
+862
| def test_reinterpret_cast_zero_sized_to_dynamic(ctx: MLIRContext): | ||
| input = alloc((0,), T.f32()) | ||
| c0 = constant(0, index=True) | ||
| c1 = constant(1, index=True) | ||
| reinterpret_cast(input, offsets=[c0], sizes=[c1], strides=[c1]) | ||
|
|
||
| # CHECK: %[[ALLOC:.*]] = memref.alloc() : memref<0xf32> | ||
| # CHECK: %[[C0:.*]] = arith.constant 0 : index | ||
| # CHECK: %[[C1:.*]] = arith.constant 1 : index | ||
| # CHECK: %[[OUT:.*]] = memref.reinterpret_cast %[[ALLOC]] to offset: [%[[C0]]], sizes: [%[[C1]]], strides: [%[[C1]]] : memref<0xf32> to memref<?xf32, strided<[?], offset: ?>> | ||
|
|
||
| filecheck_with_comments(ctx.module) |
Contributor
Author
There was a problem hiding this comment.
unrelated but just a test I forgot to check in here
7924540 to
0f09728
Compare
969aec6 to
f9f3d40
Compare
f9f3d40 to
b100fd6
Compare
b100fd6 to
76fa66e
Compare
PragmaTwice
approved these changes
Mar 9, 2026
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.
This PR adds support for using the upstream types as bare arg annotions for
func.funcs:emits
This is thanks to a PR @PragmaTwice recently landed upstream (I can't remember which one exactly...).
As well, we now support the completely "correct" version of this:
where tab-complete will now actually do the correct thing as well, and the IR emitted is
This is thanks to a PR @superbobry landed recently.
NOTE: this actually fixes a long-standing issue with the bindings/extras/DSL: namely that you could not write
@funcs without having an activeir.Context(because you cannot actually instantiateir.Typewithout an activeir.Context). Since theseGenericAliases are unevaluated until we actually emit thefunc.func, we can now write these safely without an active context.