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

Allow fmt arg to printf to be an array of i8 in non-constant space #5677

Merged
merged 8 commits into from
Jul 16, 2024

Conversation

LU-JOHN
Copy link
Contributor

@LU-JOHN LU-JOHN commented May 21, 2024

If SPV_EXT_relaxed_printf_string_address_space is enabled llvm-spirv allows the format argument to be in Generic space. Also allow format argument to point to an array of i8 instead of only an i8.

Fixes intel/llvm#11733

@LU-JOHN LU-JOHN marked this pull request as draft May 21, 2024 14:10
@LU-JOHN LU-JOHN marked this pull request as ready for review May 21, 2024 21:14
@LU-JOHN LU-JOHN requested a review from alan-baker May 22, 2024 00:05
@LU-JOHN LU-JOHN changed the title Allow fmt arg to printf to be an array of i8 in Generic space Allow fmt arg to printf to be an array of i8 in non-constant space May 22, 2024
@LU-JOHN LU-JOHN marked this pull request as draft May 22, 2024 19:51
Signed-off-by: Lu, John <[email protected]>
@LU-JOHN LU-JOHN marked this pull request as ready for review May 23, 2024 03:58
@LU-JOHN
Copy link
Contributor Author

LU-JOHN commented Jul 15, 2024

Hi @alan-baker. Could you please review these changes? Thanks.

@alan-baker alan-baker merged commit 7c77897 into KhronosGroup:main Jul 16, 2024
24 checks passed
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 31, 2024
spirv-val allows non-constant and array of 8-bit ints for printf fmt strings after KhronosGroup/SPIRV-Tools#5677. Enable spirv-val testing of this new functionality.

Signed-off-by: Lu, John <[email protected]>
Keenuts pushed a commit to Keenuts/SPIRV-Tools that referenced this pull request Nov 12, 2024
…hronosGroup#5677)

* In spirv-val allow format arg to printf to be an array of i8 in Generic space

Signed-off-by: Lu, John <[email protected]>

* Allow more addr spaces for printf format string

Signed-off-by: Lu, John <[email protected]>

* Update printf format arg testcase

Signed-off-by: Lu, John <[email protected]>

* Apply clang-format

Signed-off-by: Lu, John <[email protected]>

* Reorder code for clarity

Signed-off-by: Lu, John <[email protected]>

* Only allow other addr spaces if extension is seen

Signed-off-by: Lu, John <[email protected]>

* Add test to check printf format with extension

Signed-off-by: Lu, John <[email protected]>

* Add extension correctly

Signed-off-by: Lu, John <[email protected]>

---------

Signed-off-by: Lu, John <[email protected]>
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.

__builtin_printf not diagnosed but results in invalid SPIR-V
4 participants