diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 00:38:20 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 00:38:20 +0800 |
| commit | f6fdfb8d484b4e52cdb24a94a31b0f00d41a5eb7 (patch) | |
| tree | 9362d0230db6174acdbe095288f4bbb1c4a896a9 /backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp | |
| parent | 7e2660ad5b7ec5b74cafed27f674939691f9e0fc (diff) | |
| download | rcc-project-f6fdfb8d484b4e52cdb24a94a31b0f00d41a5eb7.tar.gz rcc-project-f6fdfb8d484b4e52cdb24a94a31b0f00d41a5eb7.tar.xz | |
[GlobalISel] Match LLVM CSE builder result semantics
Diffstat (limited to 'backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp')
| -rw-r--r-- | backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp b/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp index 6d9fa3c..9f3f0b5 100644 --- a/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp +++ b/backend/unittests/CodeGen/GlobalISel/InstructionSelectTest.cpp @@ -121,9 +121,11 @@ void testPipeline(TestContext &Context) { rcc::MachineFunctionProperty::TracksLiveness}; const rcc::riscv::RISCVSubtarget Subtarget(rcc::riscv::RISCVSubtargetFeatures::rv64gc()); rcc::MachineFunctionPassManager Pipeline; - Context.expect( - Pipeline.addPass(std::make_unique<rcc::Legalizer>(Subtarget.getLegalizerInfo())).has_value(), - "legalizer must be accepted by the pass manager"); + Context.expect(Pipeline + .addPass(std::make_unique<rcc::Legalizer>(Subtarget.getLegalizerInfo(), + rcc::OptimizationLevel::O2)) + .has_value(), + "legalizer must be accepted by the pass manager"); Context.expect(Pipeline.addPass(std::make_unique<rcc::RegBankSelect>(Subtarget.getRegBankInfo())) .has_value(), "register-bank selector must be accepted by the pass manager"); @@ -327,7 +329,8 @@ void testExtendedRV64GCPipeline(TestContext &Context) { rcc::MachineFunctionProperty::TracksLiveness}; const rcc::riscv::RISCVSubtarget Subtarget(rcc::riscv::RISCVSubtargetFeatures::rv64gc()); rcc::MachineFunctionPassManager Pipeline; - if (!Pipeline.addPass(std::make_unique<rcc::Legalizer>(Subtarget.getLegalizerInfo())) || + if (!Pipeline.addPass(std::make_unique<rcc::Legalizer>(Subtarget.getLegalizerInfo(), + rcc::OptimizationLevel::O2)) || !Pipeline.addPass(std::make_unique<rcc::RegBankSelect>(Subtarget.getRegBankInfo())) || !Pipeline.addPass( std::make_unique<rcc::InstructionSelect>(Subtarget.getInstructionSelector()))) { |
