Skip to content

Conversation

seven-mile
Copy link
Collaborator

This PR supports string literals in OpenCL end to end, making it possible to use printf. This involves two changes:

  • In CIRGen, ensure we create the global symbol for string literals with correct constant address space.
  • In LowerToLLVM, make the lowering of GlobalViewAttr aware of the upstream address space.

Other proper refactors are also applied.

Two test cases from OG CodeGen are reused. str_literals.cl is the primary test, while printf.cl is the bonus one.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

LGTM pending conflict resolutions

Copy link

github-actions bot commented Nov 9, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@bcardosolopes bcardosolopes merged commit f220fa7 into llvm:main Nov 9, 2024
6 checks passed
lanza pushed a commit that referenced this pull request Mar 18, 2025
This PR supports string literals in OpenCL end to end, making it
possible to use `printf`. This involves two changes:

* In CIRGen, ensure we create the global symbol for string literals with
correct `constant` address space.
* In LowerToLLVM, make the lowering of `GlobalViewAttr` aware of the
upstream address space.

Other proper refactors are also applied.

Two test cases from OG CodeGen are reused. `str_literals.cl` is the
primary test, while `printf.cl` is the bonus one.
terapines-osc-cir pushed a commit to Terapines/clangir that referenced this pull request Sep 2, 2025
This PR supports string literals in OpenCL end to end, making it
possible to use `printf`. This involves two changes:

* In CIRGen, ensure we create the global symbol for string literals with
correct `constant` address space.
* In LowerToLLVM, make the lowering of `GlobalViewAttr` aware of the
upstream address space.

Other proper refactors are also applied.

Two test cases from OG CodeGen are reused. `str_literals.cl` is the
primary test, while `printf.cl` is the bonus one.
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