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

Add convergent as a supported FunctionAttribute and CallInstrAttribute. #1016

Closed
wants to merge 2 commits into from

Conversation

diptorupd
Copy link

The PR adds a new attribute string to the set of known FunctionAttributes and CallInstrAttributes.

The convergent attribute is needed for certain function declarations and call instructions to generate correct SPMD code for OpenCL. Refer: https://llvm.org/docs/ConvergentOperations.html

Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

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

Thanks for the patch. This seems like an appropriate addition to support IR generation for convergent operation semantics. It would be good to add a check for IR generation into a suitable existing tests in llvmlite/tests/test_ir.py, thank you.

@diptorupd
Copy link
Author

Thanks for the patch. This seems like an appropriate addition to support IR generation for convergent operation semantics. It would be good to add a check for IR generation into a suitable existing tests in llvmlite/tests/test_ir.py, thank you.

@stuartarchibald I have added some basic unit tests. Please let me know if these are adequate.

Copy link
Contributor

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests @diptorupd, one minor comment to resolve else looks good.

llvmlite/tests/test_ir.py Show resolved Hide resolved
@diptorupd
Copy link
Author

Closing this PR in favour of #1019

@diptorupd diptorupd closed this Dec 5, 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.

3 participants