[LLVM->SPIRV] Fix untyped pointer const GEP source type#3616
Open
wenju-he wants to merge 2 commits intoKhronosGroup:mainfrom
Open
[LLVM->SPIRV] Fix untyped pointer const GEP source type#3616wenju-he wants to merge 2 commits intoKhronosGroup:mainfrom
wenju-he wants to merge 2 commits intoKhronosGroup:mainfrom
Conversation
Always emit the GEPOperator's source element type as the base type for untyped access chains so that SPV_KHR_untyped_pointers round-trips keep the original i8 indexing semantics. Drop the Scavenger-based TypedPointerType lookup, which could disagree with the GEP source type (e.g., when the pointer operand is declared as [2 x i32]) and is redundant because we already compute the expected pointer type from the GEP itself. Co-authored-by: GitHub Copilot <copilot@github.com>
Contributor
Author
|
@jcranmer-intel could you please review, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Always emit the GEPOperator's source element type as the base type for untyped access chains so that SPV_KHR_untyped_pointers round-trips keep the original i8 indexing semantics.
Drop the Scavenger-based TypedPointerType lookup, which could disagree with the GEP source type (e.g., when the pointer operand is declared as [2 x i32]) and is redundant because we already compute the expected pointer type from the GEP itself.
This PR addresses a similar issue to 1be9366, but specifically
handling the logic path when SPV_KHR_untyped_pointers is active.
The test has constant ugly GEP
https://llvm.org/docs/GetElementPtr.html#what-s-an-uglygep