Repository navigation
Remove "memory access" attributes from interface bindings. - #7734
Merged
Merged
Conversation
This was unused both in the compiler and runtime. The stream dialect includes a `stream.cmd.discard` operation and already performs copy-on-write analysis, so these concepts should already be modeled and validated sufficiently earlier in compilation. Runtime validation _could_ be useful for buffers passed in from user code, but we don't necessarily need all this supporting compiler code for that. By omitting this information, `hal.interface` ops are more likely to be recognized as duplicates, which also helps the `ElideRedundantCommands` pass remove `hal.command_buffer.push_descriptor_set` ops (as it does not currently elide matching descriptor set bindings across layouts). Note: the HAL still uses the `iree_hal_memory_access_t` type in many other places.
benvanik
requested changes
Nov 24, 2021
| // is guaranteed not to alias (ala C's `restrict` keyword). | ||
| IREE_HAL_MEMORY_ACCESS_MAY_ALIAS = 1u << 3, | ||
| // Memory may have any access. | ||
| IREE_HAL_MEMORY_ACCESS_ANY = 1u << 4, |
Collaborator
There was a problem hiding this comment.
we should probably restrict buffers from being created with this bit - unfortunately that code isn't really centralized so all the creation functions would have to do the masking off of the _ANY bit (iree_hal_heap_buffer_create, etc) - so maybe fine to ignore for now
Contributor
ScottTodd
marked this pull request as ready for review
November 24, 2021 16:39
benvanik
approved these changes
Nov 29, 2021
Merged
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.
These were (mostly) unused both in the compiler and runtime. The stream dialect includes a
stream.cmd.discardoperation and already performs copy-on-write analysis, so these concepts should already be modeled and validated sufficiently earlier in compilation. Runtime validation could be useful for buffers passed in from user code, but we don't necessarily need all this supporting compiler code for that.This is part of the
hal.interfaceoptimizations tracked in #3502:hal.interfaceops are more likely to be recognized as duplicates, which also helps theElideRedundantCommandspass removehal.command_buffer.push_descriptor_setops (as it does not currently elide matching descriptor set bindings across layouts).hal.interfaceops and 462push_descriptor_setops to 4hal.interfaceops and 127push_descriptor_setops with this changeNote: the HAL still uses the
iree_hal_memory_access_ttype in many other places.