-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RISCV] Update matchSplatAsGather to convert vectors if they have different sizes #117878
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
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
I think the title needs updated, this is just modifying the matchSplatAsGather combine right? |
This patch changes matchSplatAsGather to use vrgather no only when we see an EXTRACT_VECTOR_ELT but also for RISCVISD::VMV_X_S.
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
…e other is fixed Signed-off-by: Mikhail R. Gadelha <[email protected]>
f50860a
to
09e4d3e
Compare
Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ping @topperc I think I addressed your comments, could you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…it is in-bounds This a follow up to llvm#117878 and allows the usage of vrgather if the index we are accessing in VT is a constant and within bounds. This patch replaces the previous behavior of bailing out if the length of the search vector was greater than the vector of elements we are searching for. Since matchSplatAsGather works on EXTRACT_VECTOR_ELT, and we know the index where the element is being extracted from, we can use safely use vrgather.
…it is in-bounds This a follow up to llvm#117878 and allows the usage of vrgather if the index we are accessing in VT is a constant and within bounds. This patch replaces the previous behavior of bailing out if the length of the search vector was greater than the vector of elements we are searching for. Since matchSplatAsGather works on EXTRACT_VECTOR_ELT, and we know the index where the element is being extracted from, we can use safely use vrgather.
…in-bounds (#118873) This is a follow-up to #117878 and allows the usage of vrgather if the index we are accessing in VT is constant and within bounds. This patch replaces the previous behavior of bailing out if the length of the search vector is greater than the vector of elements we are searching for. Since matchSplatAsGather works on EXTRACT_VECTOR_ELT, and we know the index from which the element is extracted, we only need to check if we are doing an insert from a larger vector into a smaller one, in which we do an extract instead. Co-authored-by: Luke Lau [email protected] Co-authored-by: Philip Reames [email protected]
This patch updates the
matchSplatAsGather
function so we can handle vectors of different sizes. The goal is to improve the code gen for@llvm.experimental.vector.match
on RISCV.Currently, we use a scalar extract and splat instead of
vrgather
, and the patch changes that.