[SPIRV] Add support for OpCopyMemory - #1100
Open
hernanponcedeleon wants to merge 1 commit into
Open
hernanponcedeleon wants to merge 1 commit into
hernanponcedeleon wants to merge 1 commit into
Conversation
ThomasHaas
reviewed
Sep 12, 2026
Comment on lines
+171
to
+177
| if (type instanceof AggregateType aggregateType) { | ||
| return aggregateType.getFields().get(index).type(); | ||
| } | ||
| return Set.of(); | ||
| if (type instanceof ArrayType arrayType) { | ||
| return arrayType.getElementType(); | ||
| } | ||
| throw new IllegalArgumentException("Cannot index memory access type %s".formatted(type)); |
Collaborator
There was a problem hiding this comment.
We have ExpressionHelper.extractType which does the same.
Maybe we should move it to TypeFactory though.
Performance comparisonLinux x64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
4 benchmark(s) omitted because both averages were below 5 seconds. macOS ARM64Benchmark detailsMemory model: vmm
Memory model: aarch64
Memory model: power
Total
|
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.
Since
OpCopyMemorymakes use of memory operands, it plays a role from the point of view of the memory mode. Intuitively, I think it should not be any different than a program that explicity "chunks" the whole copy as a sequence of loads/stores as the implementation is doing, but TBH I have not thought very hard about possible problems from the memory model side (I mostly focused on validating the syntax restictions). @natgavrilenko let me know if you see any memory model problem.