-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add SD matchers and unit test coverage for ISD::VECTOR_SHUFFLE #119592
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
…Mask.match() with a std::equal(mask,i->getMask(). changed matchVecShuffle test to not initialize Mask. Also added a test to compare contents of MaskData to Mask.
✅ With the latest revision this PR passed the C/C++ code formatter. |
…res mask as &arrayref. Snd matches specific contents as arrayref. Removed m_mask, updated tests
…equal(). Readded cmp for capture test. Removed const for ArrayRef. Correctly capture arrayref in m_Shuffle varient. Changed m_Value(V) to m_Value, as vec contents not needed.
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 w/ minor comments.
Feel free to merge it when the merge conflicts are fixed. |
Thanks @AidanGoldfarb |
I kind of think we should have separate |
@AidanGoldfarb Do you think we could keep closer to the PatternMatch approach of m_Shuffle / m_Mask / m_SpecificMask (and m_SplatOrPoisonMask / m_ZeroMask .....) ? |
I just pushed some changes that mirror the PatternMatch approach as closely as possible. This includes |
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
@topperc do you have any other comments?
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
This PR resolves #118845. I aimed to mirror the implementation
m_Shuffle()
in PatternMatch.h.Updated SDPatternMatch.h
struct m_Mask
to match masks (ArrayRef<int>
)m_Shuffle
functions. One to match independently of mask, and one to match considering mask.struct SDShuffle_match
to matchISD::VECTOR_SHUFFLE
considering maskUpdated SDPatternMatchTest.cpp
matchVecShuffle
test, which tests the behavior of bothm_Shuffle()
functionsI am not sure if my test coverage is complete. I am not sure how to test a
false
match, simply test against a different instruction? Other tests , such as forVSelect
, test againstSelect
. I am not sure if there is an analogous instruction to compare against forVECTOR_SHUFFLE
. I would appreciate some pointers in this area. In general, please liberally critique this PR!