[llvm] Add SD matchers and unit test coverage for ISD::VECTOR_SHUFFLE (PR #119592)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 11:16:06 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 698d83218565d60580d7c71e0fce89a38134a5c6 65ab88c3f44090afb85f7734040cdd820e57b8a2 --extensions cpp,h -- llvm/include/llvm/CodeGen/SDPatternMatch.h llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index df70eed88a..6b4562e53c 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -562,7 +562,8 @@ template <typename T0, typename T1> struct SDShuffle_match {
   bool match(const MatchContext &Ctx, SDValue N) {
     if (auto *I = dyn_cast<ShuffleVectorSDNode>(N)) {
       return Op1.match(Ctx, I->getOperand(0)) &&
-             Op2.match(Ctx, I->getOperand(1)) && std::equal(Mask.begin(), Mask.end(), I->getMask().begin());
+             Op2.match(Ctx, I->getOperand(1)) &&
+             std::equal(Mask.begin(), Mask.end(), I->getMask().begin());
     }
     return false;
   }
@@ -823,8 +824,8 @@ inline BinaryOpc_match<LHS, RHS> m_Shuffle(const LHS &v1, const RHS &v2) {
 }
 
 template <typename V1_t, typename V2_t>
-inline SDShuffle_match<V1_t, V2_t>
-m_Shuffle(const V1_t &v1, const V2_t &v2, const ArrayRef<int> mask) {
+inline SDShuffle_match<V1_t, V2_t> m_Shuffle(const V1_t &v1, const V2_t &v2,
+                                             const ArrayRef<int> mask) {
   return SDShuffle_match<V1_t, V2_t>(v1, v2, mask);
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/119592


More information about the llvm-commits mailing list