diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-22 18:49:08 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-22 18:49:08 +0800 |
| commit | 8a4bb6e3b0bffa0ed79b51347b12ee4293b622a7 (patch) | |
| tree | 51278f18d8954e7abb5820cb9d529e3d5e5f322b /backend/utils/TableGen/rcc-tblgen.cpp | |
| parent | 9ca9fb23124e8c5d714e9668210855a23dd2a72f (diff) | |
| download | rcc-project-8a4bb6e3b0bffa0ed79b51347b12ee4293b622a7.tar.gz rcc-project-8a4bb6e3b0bffa0ed79b51347b12ee4293b622a7.tar.xz | |
[CodeGen] Generate RISC-V macro fusion rules
Diffstat (limited to 'backend/utils/TableGen/rcc-tblgen.cpp')
| -rw-r--r-- | backend/utils/TableGen/rcc-tblgen.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/backend/utils/TableGen/rcc-tblgen.cpp b/backend/utils/TableGen/rcc-tblgen.cpp index 5a5a419..47f0de4 100644 --- a/backend/utils/TableGen/rcc-tblgen.cpp +++ b/backend/utils/TableGen/rcc-tblgen.cpp @@ -23,6 +23,7 @@ struct CommandLine final { std::string TablesPath; std::string GlobalISelPath; std::string GlobalISelCombinerPath; + std::string MacroFusionPath; }; [[nodiscard]] bool parseCommandLine(int ArgumentCount, char *Arguments[], CommandLine &Result) { @@ -38,7 +39,7 @@ struct CommandLine final { } if (Argument == "--register-header" || Argument == "--instruction-header" || Argument == "--tables" || Argument == "--global-isel" || - Argument == "--global-isel-combiner") { + Argument == "--global-isel-combiner" || Argument == "--macro-fusion") { if (Index + 1 >= ArgumentCount) { std::cerr << "rcc-tblgen: missing value for " << Argument << '\n'; return false; @@ -52,6 +53,8 @@ struct CommandLine final { Destination = &Result.GlobalISelPath; else if (Argument == "--global-isel-combiner") Destination = &Result.GlobalISelCombinerPath; + else if (Argument == "--macro-fusion") + Destination = &Result.MacroFusionPath; else Destination = &Result.TablesPath; *Destination = Arguments[++Index]; @@ -62,12 +65,13 @@ struct CommandLine final { } if (!Result.InputPaths.empty() && !Result.RegisterHeaderPath.empty() && !Result.InstructionHeaderPath.empty() && !Result.TablesPath.empty() && - !Result.GlobalISelPath.empty() && !Result.GlobalISelCombinerPath.empty()) { + !Result.GlobalISelPath.empty() && !Result.GlobalISelCombinerPath.empty() && + !Result.MacroFusionPath.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>\n"; + "--global-isel-combiner <file> --macro-fusion <file>\n"; return false; } @@ -233,7 +237,8 @@ int main(int ArgumentCount, char *Arguments[]) { writeFile(Command.InstructionHeaderPath, Output.InstructionHeader) && writeFile(Command.TablesPath, Output.TargetTables) && writeFile(Command.GlobalISelPath, Output.GlobalISel) && - writeFile(Command.GlobalISelCombinerPath, Output.GlobalISelCombiner) + writeFile(Command.GlobalISelCombinerPath, Output.GlobalISelCombiner) && + writeFile(Command.MacroFusionPath, Output.MacroFusion) ? 0 : 1; } |
