[llvm] [X86] detectPMADDUBSW - use SDPatternMatch to handle some of the commutative matching for the zext/sext pairs. NFC. (PR #165861)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 31 06:38:38 PDT 2025
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 origin/main HEAD --extensions cpp -- llvm/lib/Target/X86/X86ISelLowering.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index d8ac9f515..007074c3f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -54474,11 +54474,12 @@ static SDValue detectPMADDUBSW(SDValue In, EVT VT, SelectionDAG &DAG,
// See if this is a signed saturation of an ADD, adding pairs of multiplies
// from even/odd elements, from zero_extend/sign_extend operands.
- //
+ //
// TODO: Handle constant vectors and use knownbits/computenumsignbits?
SDValue N00, N01, N10, N11;
- if (!sd_match(SSatVal, m_Add(m_Mul(m_ZExt(m_Value(N00)), m_SExt(m_Value(N01))),
- m_Mul(m_ZExt(m_Value(N10)), m_SExt(m_Value(N11))))))
+ if (!sd_match(SSatVal,
+ m_Add(m_Mul(m_ZExt(m_Value(N00)), m_SExt(m_Value(N01))),
+ m_Mul(m_ZExt(m_Value(N10)), m_SExt(m_Value(N11))))))
return SDValue();
// Ensure the extend is from vXi8.
``````````
</details>
https://github.com/llvm/llvm-project/pull/165861
More information about the llvm-commits
mailing list