[llvm] [VectorCombine] foldShuffleOfBinops - add support for length changing shuffles (PR #88899)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 03:26:04 PDT 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 ca9a44ef4791931fe77d123709fa1a9d18f827fd eb77e38a751b0e5add4c828c0b11a126c996a081 -- llvm/lib/Transforms/Vectorize/VectorCombine.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 368504264c..b370ef832d 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1424,7 +1424,7 @@ bool VectorCombine::foldShuffleOfBinops(Instruction &I) {
   Value *Z = B1->getOperand(0), *W = B1->getOperand(1);
   if (BinaryOperator::isCommutative(Opcode) && X != Z && Y != W)
     if (X == W || Y == Z)
-    std::swap(X, Y);
+      std::swap(X, Y);
 
   auto ConvertToUnary = [NumSrcElts](int &M) {
     if (M >= (int)NumSrcElts)

``````````

</details>


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


More information about the llvm-commits mailing list