[RISCV] Add a combine to form masked.load from unit strided load#65674
Merged
Conversation
Add a DAG combine to form a masked.load from a masked_strided_load intrinsic with stride equal to element size. This covers a couple of extra test cases, and allows us to simplify and common some existing code on the concat_vector(load, ...) to strided load transform.
topperc
reviewed
Sep 7, 2023
|
|
||
| // If the stride is equal to the element size in bytes, we can use | ||
| // a masked.load. | ||
| const unsigned ElementSizeInBits = VT.getScalarType().getSizeInBits(); |
Contributor
There was a problem hiding this comment.
getScalarStoreSize()? Which will return the size in bytes.
Contributor
Author
|
ping |
lukel97
approved these changes
Sep 11, 2023
Contributor
lukel97
left a comment
There was a problem hiding this comment.
LGTM. Should we be canonicalising this for Intrinsic::riscv_vlse and Intrinsic::riscv_vlse_mask too?
Contributor
Author
Yes. However, I'm focused on generic IR codegen and don't care too much about intrinsic usage. (Edit: For context, the strided load intrinsic is mostly a detail of our gather lowering, the others are user written intrinsics.) |
AntonRydahl
pushed a commit
to AntonRydahl/llvm-project
that referenced
this pull request
Sep 11, 2023
…m#65674) Add a DAG combine to form a masked.load from a masked_strided_load intrinsic with stride equal to element size. This covers a couple of extra test cases, and allows us to simplify and common some existing code on the concat_vector(load, ...) to strided load transform. This is the first in a mini-patch series to try and generalize our strided load and gather matching to handle more cases, and common up different approaches to the same problems in different places.
preames
added a commit
to preames/llvm-project
that referenced
this pull request
Sep 18, 2023
Add a DAG combine to form a masked.store from a masked_strided_store intrinsic with stride equal to element size. This is the store analogy to PR llvm#65674. As seen in the tests, this does pickup a few cases that we'd previously missed due to selection ordering. We match strided stores early without going through the recently added generic mscatter combines, and thus weren't recognizing the unit strided store.
ZijunZhaoCCK
pushed a commit
to ZijunZhaoCCK/llvm-project
that referenced
this pull request
Sep 19, 2023
…m#65674) Add a DAG combine to form a masked.load from a masked_strided_load intrinsic with stride equal to element size. This covers a couple of extra test cases, and allows us to simplify and common some existing code on the concat_vector(load, ...) to strided load transform. This is the first in a mini-patch series to try and generalize our strided load and gather matching to handle more cases, and common up different approaches to the same problems in different places.
lukel97
added a commit
to lukel97/llvm-project
that referenced
this pull request
Sep 19, 2023
This is the VP equivalent of llvm#65674. We already combine MGATHER loads with unit stride to MLOAD, so this extends it for EXPERIMENTAL_VP_STRIDED_LOAD.
preames
added a commit
that referenced
this pull request
Sep 19, 2023
Add a DAG combine to form a masked.store from a masked_strided_store intrinsic with stride equal to element size. This is the store analogy to PR #65674. As seen in the tests, this does pickup a few cases that we'd previously missed due to selection ordering. We match strided stores early without going through the recently added generic mscatter combines, and thus weren't recognizing the unit strided store.
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.
Add a DAG combine to form a masked.load from a masked_strided_load intrinsic with stride equal to element size. This covers a couple of extra test cases, and allows us to simplify and common some existing code on the concat_vector(load, ...) to strided load transform.
This is the first in a mini-patch series to try and generalize our strided load and gather matching to handle more cases, and common up different approaches to the same problems in different places.