[llvm] [SelectionDAG] Add m_Neg and m_Not pattern matcher and update DAGCombiner (PR #85365)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 23:55:02 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 f9a14782000e6aa2c4031bc97b20c351a9f281c3 fac4e977dfc7a13d68a6c375377b824b2b0b0c1d -- llvm/include/llvm/CodeGen/SDPatternMatch.h llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp 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 2a475651b5..2cdd857714 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -708,15 +708,13 @@ inline auto m_False() {
/// Match a negtive as a sub(0, v)
template <typename ValTy>
-inline BinaryOpc_match<SpecificInt_match, ValTy>
-m_Neg(const ValTy &V) {
+inline BinaryOpc_match<SpecificInt_match, ValTy> m_Neg(const ValTy &V) {
return m_Sub(m_Zero(), V);
}
/// Match a Not as a xor(v, 1) or xor(1, v)
template <typename ValTy>
-inline BinaryOpc_match<SpecificInt_match, ValTy, true>
-m_Not(const ValTy &V) {
+inline BinaryOpc_match<SpecificInt_match, ValTy, true> m_Not(const ValTy &V) {
return m_Xor(m_AllOnes(), V);
}
} // namespace SDPatternMatch
``````````
</details>
https://github.com/llvm/llvm-project/pull/85365
More information about the llvm-commits
mailing list