[llvm] Add SD matchers and unit test coverage for ISD::VECTOR_SHUFFLE (PR #119592)
Aidan Goldfarb via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 11:15:55 PST 2024
================
@@ -540,6 +549,24 @@ struct BinaryOpc_match {
}
};
+/// Matches shuffle.
+template <typename T0, typename T1, typename T2> struct SDShuffle_match {
+ T0 Op1;
+ T1 Op2;
+ T2 Mask;
----------------
AidanGoldfarb wrote:
Just implemented. I decided to go with the latter, storing the ArrayRef directly in `SDShuffle_match` as it seemed the simplest. I also replaced, in `SDShuffle_match`, the more generic `Mask.match(I->getMask())` with `std::equal(Mask.begin(), Mask.end(), I->getMask().begin())`, which was the same as the test coveraged I added in matchVecShuffle. Please let me know what you think of these changes.
https://github.com/llvm/llvm-project/pull/119592
More information about the llvm-commits
mailing list