Skip to content

C++: Add getSizeExpr and getSizeMult predicates to BufferAccess #12626

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

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

gsingh93
Copy link
Contributor

Adds the getSizeExpr predicate to BufferAccess, which returns the Expr corresponding to the size of the buffer access. This is useful as getSize() will only have a result if the size is a constant.

Fixes #12597

@gsingh93 gsingh93 requested a review from a team as a code owner March 22, 2023 06:56
@github-actions github-actions bot added the C++ label Mar 22, 2023
@geoffw0
Copy link
Contributor

geoffw0 commented Mar 28, 2023

LGTM once the discussions above are resolved. A very natural extension to the BufferAccess abstraction.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@gsingh93 gsingh93 force-pushed the buffer-access-size-expr branch from daa82a9 to 9dbba96 Compare March 29, 2023 08:05
@gsingh93
Copy link
Contributor Author

Added the QLDoc and the getSizeMult() predicate, modeled off of how AllocationExpr works.

Copy link
Contributor Author

@gsingh93 gsingh93 left a comment

Choose a reason for hiding this comment

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

I also noticed there were no tests for BufferAccess in library-tests, let me know if I'm missing it or it really doesn't exist.

@gsingh93 gsingh93 force-pushed the buffer-access-size-expr branch 2 times, most recently from 5738250 to ad3324e Compare March 29, 2023 15:25
@gsingh93 gsingh93 force-pushed the buffer-access-size-expr branch from ad3324e to abec99b Compare March 29, 2023 15:26
@gsingh93 gsingh93 changed the title C++: Add getSizeExpr predicate to BufferAccess C++: Add getSizeExpr and getSizeMult predicates to BufferAccess Mar 29, 2023
@gsingh93
Copy link
Contributor Author

Should be good to go now.

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM! I took the liberty of adding a change note entry to make CI happy. I hope that's alright :)

@MathiasVP MathiasVP merged commit 62bc807 into github:main Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++: Add getSizeExpr to BufferAccess
3 participants