Skip to content
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

Adding a memref linearizer pass #20335

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Adding a memref linearizer pass #20335

wants to merge 8 commits into from

Conversation

lialan
Copy link
Contributor

@lialan lialan commented Mar 21, 2025

This PR responds to #20226

This PR is based on the GPU/DecomposeMemRefs pass in upstream, with the following changes:

  • support vector dialect ops
  • instead of decompose memrefs to rank-0 memrefs, changed to decompose memrefs to rank-1.

Notes:

  • when calculating linearized offsets, it dissolves memref's offset and make it part of the linear index calculation. So it is possible to result in out-of-bound accesses.

What is next?

  • Refactor and push back to upstream.
  • consider move the upstream pass from GPU to common.
  • use it as prerequisite for passes such as EmulateNarrowTypes.

lialan added 5 commits March 21, 2025 14:22

Unverified

This user has not yet uploaded their public signing key.
@lialan lialan requested a review from krzysz00 March 21, 2025 14:54
lialan added 3 commits March 21, 2025 15:52
@krzysz00
Copy link
Contributor

High level comment: we might want - like we have in narrow type emulation - explicit rewrites for alloc() and friends (and so, IREE-side, hal.interface.buffer_subspan)

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.

None yet

2 participants