[llvm] [DAG][NFC] Remove unnecessary default arguments (PR #100737)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 06:00:15 PDT 2024
https://github.com/michaelmaitland updated https://github.com/llvm/llvm-project/pull/100737
>From dd0ebb5c1a708d5a33def5a52f2dc4d99b40eefa Mon Sep 17 00:00:00 2001
From: Michael Maitland <michaeltmaitland at gmail.com>
Date: Fri, 26 Jul 2024 06:16:09 -0700
Subject: [PATCH 1/3] [DAG][NFC] Remove unnecessary default arguments
---
llvm/include/llvm/CodeGen/SDPatternMatch.h | 57 +++++++++++-----------
1 file changed, 28 insertions(+), 29 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index ad1c5415055c2e..8a704fe48aef77 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -477,10 +477,9 @@ struct TernaryOpc_match {
};
template <typename T0_P, typename T1_P, typename T2_P>
-inline TernaryOpc_match<T0_P, T1_P, T2_P, false, false>
+inline TernaryOpc_match<T0_P, T1_P, T2_P>
m_SetCC(const T0_P &LHS, const T1_P &RHS, const T2_P &CC) {
- return TernaryOpc_match<T0_P, T1_P, T2_P, false, false>(ISD::SETCC, LHS, RHS,
- CC);
+ return TernaryOpc_match<T0_P, T1_P, T2_P>(ISD::SETCC, LHS, RHS, CC);
}
template <typename T0_P, typename T1_P, typename T2_P>
@@ -529,9 +528,9 @@ struct BinaryOpc_match {
};
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_BinOp(unsigned Opc, const LHS &L,
+inline BinaryOpc_match<LHS, RHS> m_BinOp(unsigned Opc, const LHS &L,
const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(Opc, L, R);
+ return BinaryOpc_match<LHS, RHS>(Opc, L, R);
}
template <typename LHS, typename RHS>
inline BinaryOpc_match<LHS, RHS, true> m_c_BinOp(unsigned Opc, const LHS &L,
@@ -557,13 +556,13 @@ inline BinaryOpc_match<LHS, RHS, true> m_Add(const LHS &L, const RHS &R) {
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_Sub(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SUB, L, R);
+inline BinaryOpc_match<LHS, RHS> m_Sub(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SUB, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, true> m_Mul(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, true>(ISD::MUL, L, R);
+inline BinaryOpc_match<LHS, RHS> m_Mul(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::MUL, L, R);
}
template <typename LHS, typename RHS>
@@ -602,35 +601,35 @@ inline BinaryOpc_match<LHS, RHS, true> m_UMax(const LHS &L, const RHS &R) {
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_UDiv(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::UDIV, L, R);
+inline BinaryOpc_match<LHS, RHS> m_UDiv(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::UDIV, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_SDiv(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SDIV, L, R);
+inline BinaryOpc_match<LHS, RHS> m_SDiv(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SDIV, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_URem(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::UREM, L, R);
+inline BinaryOpc_match<LHS, RHS> m_URem(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::UREM, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_SRem(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SREM, L, R);
+inline BinaryOpc_match<LHS, RHS> m_SRem(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SREM, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_Shl(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SHL, L, R);
+inline BinaryOpc_match<LHS, RHS> m_Shl(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SHL, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_Sra(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SRA, L, R);
+inline BinaryOpc_match<LHS, RHS> m_Sra(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SRA, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_Srl(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::SRL, L, R);
+inline BinaryOpc_match<LHS, RHS> m_Srl(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::SRL, L, R);
}
template <typename LHS, typename RHS>
@@ -639,8 +638,8 @@ inline BinaryOpc_match<LHS, RHS, true> m_FAdd(const LHS &L, const RHS &R) {
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_FSub(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::FSUB, L, R);
+inline BinaryOpc_match<LHS, RHS> m_FSub(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::FSUB, L, R);
}
template <typename LHS, typename RHS>
@@ -649,13 +648,13 @@ inline BinaryOpc_match<LHS, RHS, true> m_FMul(const LHS &L, const RHS &R) {
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_FDiv(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::FDIV, L, R);
+inline BinaryOpc_match<LHS, RHS> m_FDiv(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::FDIV, L, R);
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS, false> m_FRem(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS, false>(ISD::FREM, L, R);
+inline BinaryOpc_match<LHS, RHS> m_FRem(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS>(ISD::FREM, L, R);
}
// === Unary operations ===
>From 83a575968adc739b2a1eee0aa2047140c6b96f67 Mon Sep 17 00:00:00 2001
From: Michael Maitland <michaeltmaitland at gmail.com>
Date: Fri, 26 Jul 2024 07:24:45 -0700
Subject: [PATCH 2/3] fixup! clang-format
---
llvm/include/llvm/CodeGen/SDPatternMatch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index 8a704fe48aef77..a251e2583f2df9 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -529,7 +529,7 @@ struct BinaryOpc_match {
template <typename LHS, typename RHS>
inline BinaryOpc_match<LHS, RHS> m_BinOp(unsigned Opc, const LHS &L,
- const RHS &R) {
+ const RHS &R) {
return BinaryOpc_match<LHS, RHS>(Opc, L, R);
}
template <typename LHS, typename RHS>
>From 50ea0c4a1709b8b4e44adebe3b9bec5bf66cdb7f Mon Sep 17 00:00:00 2001
From: Michael Maitland <michaeltmaitland at gmail.com>
Date: Wed, 7 Aug 2024 05:59:34 -0700
Subject: [PATCH 3/3] fixup! fix mul (changed on accident initially)
---
llvm/include/llvm/CodeGen/SDPatternMatch.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/CodeGen/SDPatternMatch.h b/llvm/include/llvm/CodeGen/SDPatternMatch.h
index a251e2583f2df9..96ece1559bc437 100644
--- a/llvm/include/llvm/CodeGen/SDPatternMatch.h
+++ b/llvm/include/llvm/CodeGen/SDPatternMatch.h
@@ -561,8 +561,8 @@ inline BinaryOpc_match<LHS, RHS> m_Sub(const LHS &L, const RHS &R) {
}
template <typename LHS, typename RHS>
-inline BinaryOpc_match<LHS, RHS> m_Mul(const LHS &L, const RHS &R) {
- return BinaryOpc_match<LHS, RHS>(ISD::MUL, L, R);
+inline BinaryOpc_match<LHS, RHS, true> m_Mul(const LHS &L, const RHS &R) {
+ return BinaryOpc_match<LHS, RHS, true>(ISD::MUL, L, R);
}
template <typename LHS, typename RHS>
More information about the llvm-commits
mailing list