File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
llvm/include/llvm/CodeGen Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -1145,16 +1145,17 @@ template <typename... PatternTs> struct ReassociatableOpc_match {
1145
1145
1146
1146
template <typename MatchContext>
1147
1147
bool match (const MatchContext &Ctx, SDValue N) {
1148
+ constexpr size_t NumPatterns = std::tuple_size_v<std::tuple<PatternTs...>>;
1149
+
1148
1150
SmallVector<SDValue> Leaves;
1149
1151
collectLeaves (N, Leaves);
1150
- if (Leaves.size () != std::tuple_size_v<std::tuple<PatternTs...>> )
1152
+ if (Leaves.size () != NumPatterns )
1151
1153
return false ;
1152
1154
1153
1155
// Matches[I][J] == true iff sd_context_match(Leaves[I], Ctx,
1154
1156
// std::get<J>(Patterns)) == true
1155
- std::array<SmallBitVector, std::tuple_size_v<std::tuple<PatternTs...>>>
1156
- Matches;
1157
- for (size_t I = 0 , N = Leaves.size (); I < N; I++) {
1157
+ std::array<SmallBitVector, NumPatterns> Matches;
1158
+ for (size_t I = 0 ; I != NumPatterns; I++) {
1158
1159
SmallVector<bool > MatchResults;
1159
1160
std::apply (
1160
1161
[&](auto &...P ) {
@@ -1163,7 +1164,7 @@ template <typename... PatternTs> struct ReassociatableOpc_match {
1163
1164
Patterns);
1164
1165
}
1165
1166
1166
- SmallBitVector Used (std::tuple_size_v<std::tuple<PatternTs...>> );
1167
+ SmallBitVector Used (NumPatterns );
1167
1168
return reassociatableMatchHelper (Matches, Used);
1168
1169
}
1169
1170
You can’t perform that action at this time.
0 commit comments