Skip to content

Fix incorrect translation of calls to a builtin that returns a structure #2722

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

Conversation

VyacheslavLevytskyy
Copy link
Contributor

@VyacheslavLevytskyy VyacheslavLevytskyy commented Sep 18, 2024

This PR fixes #2721
The root cause is that https://github.com/bwlodarcz/SPIRV-LLVM-Translator/blob/ca48eaf52ae791abc61cba13ef383f022e151e9f/lib/SPIRV/SPIRVUtil.cpp#L2207 doesn't preserve equivalence of values, inserting a pointer where a value of function return's type was before.

A new test case is added from the reproducer of #2721
Existing test cases are passing as is.

…ared a well-known pattern (store/load) for itself
@MrSidims MrSidims requested review from vmaksimo and svenvh September 19, 2024 09:50
@VyacheslavLevytskyy VyacheslavLevytskyy merged commit dc1221c into KhronosGroup:main Sep 19, 2024
9 checks passed
VyacheslavLevytskyy added a commit that referenced this pull request Feb 26, 2025
… returns a structure (#2722) (#3030)

This PR fixes the issue with Khronos Translator incorrectly translating
calls to builtins that returns a structure and generating incorrect
extractvalue applied to a pointer. The PR is to fix the issue by
preserving equivalence of newly inserted values with prior values of
function return's type.
VyacheslavLevytskyy added a commit that referenced this pull request Feb 26, 2025
… returns a structure (#2722) (#3029)

This PR fixes the issue with Khronos Translator incorrectly translating
calls to builtins that returns a structure and generating incorrect
extractvalue applied to a pointer. The PR is to fix the issue by
preserving equivalence of newly inserted values with prior values of
function return's type.
VyacheslavLevytskyy added a commit that referenced this pull request Feb 26, 2025
… returns a structure (#2722) (#3031)

This PR fixes the issue with Khronos Translator incorrectly translating
calls to builtins that returns a structure and generating incorrect
extractvalue applied to a pointer. The PR is to fix the issue by
preserving equivalence of newly inserted values with prior values of
function return's type.
VyacheslavLevytskyy added a commit that referenced this pull request Feb 26, 2025
… returns a structure (#2722) (#3032)

This PR fixes the issue with Khronos Translator incorrectly translating
calls to builtins that returns a structure and generating incorrect
extractvalue applied to a pointer. The PR is to fix the issue by
preserving equivalence of newly inserted values with prior values of
function return's type.
VyacheslavLevytskyy added a commit that referenced this pull request Feb 27, 2025
… returns a structure (#2722) (#3028)

This PR fixes the issue with Khronos Translator incorrectly translating
calls to builtins that returns a structure and generating incorrect
extractvalue applied to a pointer. The PR is to fix the issue by
preserving equivalence of newly inserted values with prior values of
function return's type.
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.

Incorrect translation of calls to a builtin that returns a structure
3 participants