diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-22 19:16:18 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-22 19:16:18 +0800 |
| commit | 75f1223070749b0df3002226ebbb474c68c71f90 (patch) | |
| tree | e3b386180f6ea394381862d5ff9b5394ac0a6481 /backend/utils/TableGen/rcc-tblgen.cpp | |
| parent | 36b0be1ec1558f88d4f031a1817c3a4c2cba07a6 (diff) | |
| download | rcc-project-75f1223070749b0df3002226ebbb474c68c71f90.tar.gz rcc-project-75f1223070749b0df3002226ebbb474c68c71f90.tar.xz | |
[RISCV] Generate MC pseudo lowering
Diffstat (limited to 'backend/utils/TableGen/rcc-tblgen.cpp')
| -rw-r--r-- | backend/utils/TableGen/rcc-tblgen.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/backend/utils/TableGen/rcc-tblgen.cpp b/backend/utils/TableGen/rcc-tblgen.cpp index 47f0de4..cf10665 100644 --- a/backend/utils/TableGen/rcc-tblgen.cpp +++ b/backend/utils/TableGen/rcc-tblgen.cpp @@ -24,6 +24,7 @@ struct CommandLine final { std::string GlobalISelPath; std::string GlobalISelCombinerPath; std::string MacroFusionPath; + std::string MCPseudoLoweringPath; }; [[nodiscard]] bool parseCommandLine(int ArgumentCount, char *Arguments[], CommandLine &Result) { @@ -39,7 +40,8 @@ struct CommandLine final { } if (Argument == "--register-header" || Argument == "--instruction-header" || Argument == "--tables" || Argument == "--global-isel" || - Argument == "--global-isel-combiner" || Argument == "--macro-fusion") { + Argument == "--global-isel-combiner" || Argument == "--macro-fusion" || + Argument == "--mc-pseudo-lowering") { if (Index + 1 >= ArgumentCount) { std::cerr << "rcc-tblgen: missing value for " << Argument << '\n'; return false; @@ -55,6 +57,8 @@ struct CommandLine final { Destination = &Result.GlobalISelCombinerPath; else if (Argument == "--macro-fusion") Destination = &Result.MacroFusionPath; + else if (Argument == "--mc-pseudo-lowering") + Destination = &Result.MCPseudoLoweringPath; else Destination = &Result.TablesPath; *Destination = Arguments[++Index]; @@ -66,12 +70,13 @@ struct CommandLine final { if (!Result.InputPaths.empty() && !Result.RegisterHeaderPath.empty() && !Result.InstructionHeaderPath.empty() && !Result.TablesPath.empty() && !Result.GlobalISelPath.empty() && !Result.GlobalISelCombinerPath.empty() && - !Result.MacroFusionPath.empty()) { + !Result.MacroFusionPath.empty() && !Result.MCPseudoLoweringPath.empty()) { return true; } std::cerr << "usage: rcc-tblgen --input <file> [--input <fragment>]... --register-header <file> " "--instruction-header <file> --tables <file> --global-isel <file> " - "--global-isel-combiner <file> --macro-fusion <file>\n"; + "--global-isel-combiner <file> --macro-fusion <file> " + "--mc-pseudo-lowering <file>\n"; return false; } @@ -176,7 +181,8 @@ combineDescriptionSources(const std::vector<std::string> &Paths, continue; } if (Section.Name != "instructions" && Section.Name != "selection_rules" && - Section.Name != "combiner_rules") { + Section.Name != "combiner_rules" && Section.Name != "macro_fusion_rules" && + Section.Name != "mc_pseudo_expansions") { std::cerr << "rcc-tblgen: duplicate description section '" << Section.Name << "' in '" << Paths[Index] << "'\n"; return std::nullopt; @@ -238,7 +244,8 @@ int main(int ArgumentCount, char *Arguments[]) { writeFile(Command.TablesPath, Output.TargetTables) && writeFile(Command.GlobalISelPath, Output.GlobalISel) && writeFile(Command.GlobalISelCombinerPath, Output.GlobalISelCombiner) && - writeFile(Command.MacroFusionPath, Output.MacroFusion) + writeFile(Command.MacroFusionPath, Output.MacroFusion) && + writeFile(Command.MCPseudoLoweringPath, Output.MCPseudoLowering) ? 0 : 1; } |
