aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 04:21:14 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-12 04:21:14 +0800
commit1775d50ba02dab033c639f5c8fedd46cb6613bef (patch)
treeb4ca387ff0015862cdf90a8652ad35402fa9af69 /backend/unittests
parent64c0360a6646dd1d3f75b8d1ed11ec4da825256b (diff)
downloadrcc-project-1775d50ba02dab033c639f5c8fedd46cb6613bef.tar.gz
rcc-project-1775d50ba02dab033c639f5c8fedd46cb6613bef.tar.xz
[Tooling] Adopt LLVM MIR command-line spellings
Diffstat (limited to 'backend/unittests')
-rw-r--r--backend/unittests/Tooling/BackendManifestTest.cpp2
-rw-r--r--backend/unittests/Tooling/MIRReducerFuzzerTest.cpp4
-rw-r--r--backend/unittests/Tooling/PipelineDriverTest.cpp18
3 files changed, 13 insertions, 11 deletions
diff --git a/backend/unittests/Tooling/BackendManifestTest.cpp b/backend/unittests/Tooling/BackendManifestTest.cpp
index 5a6a0e9..36a023c 100644
--- a/backend/unittests/Tooling/BackendManifestTest.cpp
+++ b/backend/unittests/Tooling/BackendManifestTest.cpp
@@ -125,7 +125,7 @@ int main() {
if (!keyDiffers(Base, Changed, Input, *Fingerprint))
return tooling_test::fail("cache key must include the optimization level");
Changed = Base;
- Changed.PassPipeline = {"Legalizer"};
+ Changed.PassPipeline = {"legalizer"};
if (!keyDiffers(Base, Changed, Input, *Fingerprint))
return tooling_test::fail("cache key must include the pass pipeline");
Changed = Base;
diff --git a/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp b/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
index 9c95d75..9526a9f 100644
--- a/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
+++ b/backend/unittests/Tooling/MIRReducerFuzzerTest.cpp
@@ -90,7 +90,7 @@ int main() {
}
rcc::tooling::BackendInvocation PassInvocation = Invocation;
- PassInvocation.PassPipeline = {"Legalizer", "RegisterBankSelect", "InstructionSelect"};
+ PassInvocation.PassPipeline = {"legalizer", "regbankselect", "instruction-select"};
rcc::tooling::MIRReducerOptions PassOptions;
PassOptions.Mode = rcc::tooling::ReductionMode::PreserveFailure;
PassOptions.MaximumAttempts = 32;
@@ -114,7 +114,7 @@ int main() {
if (!RegBank)
return tooling_test::fail(RegBank.error().message());
rcc::tooling::BackendInvocation FailureInvocation = Invocation;
- FailureInvocation.PassPipeline = {"InstructionSelect"};
+ FailureInvocation.PassPipeline = {"instruction-select"};
FailureInvocation.ActionFuel = 0;
const auto PreservesActionFailure = [&](std::string_view MIR,
const rcc::tooling::BackendInvocation &Candidate) {
diff --git a/backend/unittests/Tooling/PipelineDriverTest.cpp b/backend/unittests/Tooling/PipelineDriverTest.cpp
index 618bf33..273de52 100644
--- a/backend/unittests/Tooling/PipelineDriverTest.cpp
+++ b/backend/unittests/Tooling/PipelineDriverTest.cpp
@@ -103,7 +103,7 @@ int main() {
rcc::tooling::BackendInvocation AtomicOnlyInvocation = Invocation;
AtomicOnlyInvocation.Features = {"+a", "+zacas", "+zabha"};
- AtomicOnlyInvocation.PassPipeline = {"Legalizer"};
+ AtomicOnlyInvocation.PassPipeline = {"legalizer"};
auto CanonicalAtomicOnly = AtomicOnlyInvocation.canonicalizeAndVerify();
if (!CanonicalAtomicOnly)
return tooling_test::fail(CanonicalAtomicOnly.error().message());
@@ -194,8 +194,8 @@ int main() {
if (!PrintInput)
return tooling_test::fail(PrintInput.error().message());
rcc::tooling::PipelineControls PrintControls;
- PrintControls.PrintBefore = {"Legalizer"};
- PrintControls.PrintAfter = {"Legalizer#1"};
+ PrintControls.PrintBefore = {"legalizer"};
+ PrintControls.PrintAfter = {"legalizer#1"};
auto PrintPoints =
rcc::tooling::runRV64GCPipeline(PrintInput->Document, *Target, Invocation, PrintControls);
if (!PrintPoints || PrintPoints->Snapshots.size() != 2 ||
@@ -209,22 +209,24 @@ int main() {
if (!StopInput)
return tooling_test::fail(StopInput.error().message());
rcc::tooling::PipelineControls StopControls;
- StopControls.StopAfter = "Legalizer#1";
+ StopControls.StopAfter = "legalizer#1";
auto Stopped =
rcc::tooling::runRV64GCPipeline(StopInput->Document, *Target, Invocation, StopControls);
const rcc::MachineFunction *StoppedFunction = StopInput->Document.unit().functionAt(0);
if (!Stopped || StoppedFunction == nullptr ||
rcc::tooling::stageForFunction(*StoppedFunction) !=
rcc::tooling::BackendStage::LegalizedMIR ||
- Stopped->ExecutedPasses.size() != 1) {
+ Stopped->ExecutedPasses.size() != 2 ||
+ Stopped->ExecutedPasses[0].Pass != "riscv-prelegalizer-combiner" ||
+ Stopped->ExecutedPasses[1].Pass != "legalizer") {
return tooling_test::fail("stop-after must stop at the selected pass occurrence");
}
- StopControls.StopAfter = "Legalizer#0";
+ StopControls.StopAfter = "legalizer#0";
if (rcc::tooling::runRV64GCPipeline(StopInput->Document, *Target, Invocation, StopControls))
return tooling_test::fail("pipeline controls must reject occurrence zero");
rcc::tooling::BackendInvocation MixedPipeline = Invocation;
- MixedPipeline.PassPipeline = {"default", "Legalizer"};
+ MixedPipeline.PassPipeline = {"default", "legalizer"};
auto MixedInput =
rcc::tooling::parseAndCanonicalizeMIR("mixed-pipeline.mir", *Source, *Target, MixedPipeline);
if (!MixedInput)
@@ -263,7 +265,7 @@ int main() {
if (!RegBankRun)
return tooling_test::fail(RegBankRun.error().message());
rcc::tooling::BackendInvocation InstructionSelectInvocation = Invocation;
- InstructionSelectInvocation.PassPipeline = {"InstructionSelect"};
+ InstructionSelectInvocation.PassPipeline = {"instruction-select"};
InstructionSelectInvocation.ActionFuel = 0;
auto RejectedInput = rcc::tooling::parseAndCanonicalizeMIR(
"action-rejected.mir", std::string(RegBankRun->text()), *Target, InstructionSelectInvocation);