Skip to content

Clean up HAL dispatch ops to not track redundant state. - #3121

Merged
ScottTodd merged 3 commits into
iree-org:mainfrom
ScottTodd:nested-refs-cleanup
Sep 11, 2020
Merged

ScottTodd merged 3 commits into
iree-org:mainfrom
ScottTodd:nested-refs-cleanup

Conversation

@ScottTodd

Copy link
Copy Markdown
Member
  • hal.device can be retrieved from hal.command_buffer
  • hal.executable can be retrieved from @executable::@target::@entry_point nested references

This adds a new hal.command_buffer.device op to help keep the IR tidy, with a new canonicalization pattern for when it refers to a device that was created in the same scope.

Since the new op is created within a hal.device.switch, the canonicalization is not used. However, since MaterializeResourceCachesPass does not yet support multiple devices, the lowerings still "work" as written today, without needing to add a runtime op for the device query.

Progress on #1890

* `hal.device` can be retrieved from `hal.command_buffer`
* `hal.executable` can be retrieved from `@executable::@target::@entry_point` nested references

This adds a new `hal.command_buffer.device` op to help keep the IR tidy, with a new canonicalization pattern for when it refers to a device that was created in the same scope.

Since the new op is created within a `hal.device.switch`, the canonicalization is not used. However, since `MaterializeResourceCachesPass` does not yet support multiple devices, the lowerings still "work" as written today, without needing to add a runtime op for the device query.
@ScottTodd ScottTodd added the compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm) label Sep 11, 2020
@ScottTodd
ScottTodd requested a review from benvanik September 11, 2020 15:19
@google-cla google-cla Bot added the cla: yes label Sep 11, 2020

@benvanik benvanik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so nice!

@ScottTodd
ScottTodd merged commit 45d9716 into iree-org:main Sep 11, 2020
@ScottTodd
ScottTodd deleted the nested-refs-cleanup branch September 11, 2020 17:13
MaheshRavishankar pushed a commit to MaheshRavishankar/iree that referenced this pull request Sep 14, 2020
* `hal.device` can be retrieved from `hal.command_buffer`
* `hal.executable` can be retrieved from `@executable::@target::@entry_point` nested references

This adds a new `hal.command_buffer.device` op to help keep the IR tidy, with a new canonicalization pattern for when it refers to a device that was created in the same scope.

Since the new op is created within a `hal.device.switch`, the canonicalization is not used. However, since `MaterializeResourceCachesPass` does not yet support multiple devices, the lowerings still "work" as written today, without needing to add a runtime op for the device query.

Progress on iree-org#1890
@ScottTodd ScottTodd mentioned this pull request Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler/dialects Relating to the IREE compiler dialects (flow, hal, vm)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants