Skip to content

[stdlib] Add parameter for generator for UInt #4298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

martinvuyk
Copy link
Contributor

Part of #4283

@martinvuyk martinvuyk requested a review from a team as a code owner April 5, 2025 23:32
Copy link
Collaborator

@JoeLoser JoeLoser left a comment

Choose a reason for hiding this comment

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

Can you add some simple unit tests to show it works as expected for the various cases, please?

@JoeLoser JoeLoser self-assigned this Apr 7, 2025
@martinvuyk
Copy link
Contributor Author

martinvuyk commented Apr 7, 2025

@JoeLoser You were right wanting to add tests. It turns out the loop is returning Int instead of UInt. I imagine that at some point the UInt yield type gets lowered to __mlir_type.index/changed to IntLiteral and the default path for reconstruction is then through Int. I think this would dovetail nicely with an idea I've been having: I know it might get nasty, but maybe we can create "conditional materialization" where IntLiteral lowers to an Int when it is negative and UInt otherwise.

@martinvuyk martinvuyk marked this pull request as draft April 7, 2025 11:23
Signed-off-by: martinvuyk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants