[llvm] [SelectionDAG] Add space-optimized forms of OPC_CheckPatternPredicate (PR #73319)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 20:33:39 PST 2024
================
@@ -85,7 +83,25 @@ class MatcherTableEmitter {
public:
MatcherTableEmitter(const CodeGenDAGPatterns &cgp)
- : CGP(cgp), OpcodeCounts(Matcher::HighestKind + 1, 0) {}
+ : CGP(cgp), OpcodeCounts(Matcher::HighestKind + 1, 0) {
+ // Sort ComplexPatterns by usage.
+ auto &ComplexPatternUsage = cgp.getComplexPatternUsage();
+ std::vector<std::pair<const ComplexPattern *, unsigned>> ComplexPatternList(
+ ComplexPatternUsage.begin(), ComplexPatternUsage.end());
+ sort(ComplexPatternList,
+ [](auto &A, auto &B) { return A.second > B.second; });
+ for (auto &ComplexPattern : ComplexPatternList)
----------------
arsenm wrote:
const?
https://github.com/llvm/llvm-project/pull/73319
More information about the llvm-commits
mailing list