[llvm] [TableGen] Split DAGISelMatcherOpt FactorNodes into 2 functions. NFC (PR #125330)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 2 19:43:18 PST 2025
================
@@ -492,6 +480,20 @@ static void FactorNodes(std::unique_ptr<Matcher> &InputMatcherPtr) {
Scope->resetChild(i, OptionsToMatch[i]);
}
+/// Search a ScopeMatcher to factor with FactorScope.
+static void FactorNodes(std::unique_ptr<Matcher> &InputMatcherPtr) {
----------------
topperc wrote:
The code change the contents of the unique_ptr by calling unique_ptr::reset in several places. It replaces the ScopeMatcher with a SwitchOpcodeMatcher/SwitchType matcher by changing what the owner of ScopeMatcher is pointing to. This requires being able to modify the unique_ptr inside the owner.
https://github.com/llvm/llvm-project/pull/125330
More information about the llvm-commits
mailing list