Skip to content
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

EmitC: Use brace initialization for values of opaque type when lowering ub.posion #429

Merged
merged 8 commits into from
Jan 9, 2025

Conversation

TinaAMD
Copy link

@TinaAMD TinaAMD commented Dec 18, 2024

Values of opaque type are currently initialized to integers, which may be invalid. Instead, lower them using brace-initializers. The emitc code will represent C++.

Comes without a test since there are currently no types I am aware of that are converted to opaque types.

When converting from UB to EmitC, we have no means to identify a proper initial value when the type is opaque. Report a match failure.
Copy link
Collaborator

@josel-amd josel-amd left a comment

Choose a reason for hiding this comment

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

LGTM

@TinaAMD TinaAMD marked this pull request as draft December 18, 2024 15:24
@josel-amd josel-amd self-requested a review January 6, 2025 09:21
@josel-amd
Copy link
Collaborator

Do you still want to merge this?

@TinaAMD
Copy link
Author

TinaAMD commented Jan 6, 2025

Do you still want to merge this?

I'll update it and re-request reviews.

Values of opaque type are currently initialized to integers, which may be invalid. Instead, lower them using brace-initializers. The emitc code will represent C++.
@TinaAMD TinaAMD changed the title EmitC: Fail UBToEmitC opaque type initialization EmitC: Use brace initialization for values of opaque type when lowering ub.posion Jan 6, 2025
@TinaAMD TinaAMD requested a review from cferry-AMD January 6, 2025 10:40
@TinaAMD TinaAMD marked this pull request as ready for review January 6, 2025 10:40
@mgehre-amd
Copy link
Collaborator

Upstream will ask you to update https://mlir.llvm.org/docs/Dialects/EmitC/ with the C++ when ... condition. (This is some doc file in the repo)

@TinaAMD
Copy link
Author

TinaAMD commented Jan 6, 2025

Upstream will ask you to update https://mlir.llvm.org/docs/Dialects/EmitC/ with the C++ when ... condition. (This is some doc file in the repo)

Thanks for the pointer! Added it.

@TinaAMD TinaAMD merged commit 2f5bd8b into feature/fused-ops Jan 9, 2025
4 checks passed
@TinaAMD TinaAMD deleted the tina.ub-to-emitc-opaque-types branch January 9, 2025 09:44
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.

4 participants