Skip to content

Disallow Type::narrow() and Type::widen() from producing bitwidths between 1 and 8 bits#6622

Merged
rootjalex merged 3 commits intomainfrom
rootjalex/find_intrinsics-bugfix
Feb 22, 2022
Merged

Disallow Type::narrow() and Type::widen() from producing bitwidths between 1 and 8 bits#6622
rootjalex merged 3 commits intomainfrom
rootjalex/find_intrinsics-bugfix

Conversation

@rootjalex
Copy link
Copy Markdown
Member

Allowing these methods to create bitwidths of 2 and 4 can cause issues with find_intrinsics. Specifically, this fixes #6601 .

Discussed with @abadams .

@abadams
Copy link
Copy Markdown
Member

abadams commented Feb 18, 2022

What should happen if you narrow a uint1?

@rootjalex
Copy link
Copy Markdown
Member Author

@abadams I guess either an error, or a uint1. I think an error is better, and am happy to add that to this PR

@abadams
Copy link
Copy Markdown
Member

abadams commented Feb 19, 2022

An error sgtm

@rootjalex rootjalex requested review from abadams and halidebuildbots and removed request for halidebuildbots February 21, 2022 16:23
@rootjalex
Copy link
Copy Markdown
Member Author

Test failure seems unrelated

@rootjalex rootjalex merged commit b2edbc9 into main Feb 22, 2022
@rootjalex rootjalex deleted the rootjalex/find_intrinsics-bugfix branch February 22, 2022 20:09
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.

FindIntrinsics creates incorrect IR for casts from bool to arithmetic type

2 participants