[llvm] [SelectionDAG] Add space-optimized forms of OPC_CheckPatternPredicate (PR #73319)
Wang Pengcheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 03:50:55 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)
----------------
wangpc-pp wrote:
Fixed in #73310.
https://github.com/llvm/llvm-project/pull/73319
More information about the llvm-commits
mailing list