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 {
11451145
11461146 template <typename MatchContext>
11471147 bool match (const MatchContext &Ctx, SDValue N) {
1148+ constexpr size_t NumPatterns = std::tuple_size_v<std::tuple<PatternTs...>>;
1149+
11481150 SmallVector<SDValue> Leaves;
11491151 collectLeaves (N, Leaves);
1150- if (Leaves.size () != std::tuple_size_v<std::tuple<PatternTs...>> )
1152+ if (Leaves.size () != NumPatterns )
11511153 return false ;
11521154
11531155 // Matches[I][J] == true iff sd_context_match(Leaves[I], Ctx,
11541156 // 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++) {
11581159 SmallVector<bool > MatchResults;
11591160 std::apply (
11601161 [&](auto &...P ) {
@@ -1163,7 +1164,7 @@ template <typename... PatternTs> struct ReassociatableOpc_match {
11631164 Patterns);
11641165 }
11651166
1166- SmallBitVector Used (std::tuple_size_v<std::tuple<PatternTs...>> );
1167+ SmallBitVector Used (NumPatterns );
11671168 return reassociatableMatchHelper (Matches, Used);
11681169 }
11691170
You can’t perform that action at this time.
0 commit comments