aboutsummaryrefslogtreecommitdiff
path: root/backend/unittests
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 20:16:09 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-11 20:16:09 +0800
commitcd2e88b9618ba7c2f6fcfac901e81f4a302a34c9 (patch)
treedffd656415955f1cc7431e790bec6b4e3c7b58ef /backend/unittests
parentd53149886f39884efe3da5cae67653f9f86132d6 (diff)
downloadrcc-project-cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9.tar.gz
rcc-project-cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9.tar.xz
[CodeGen] Remove redundant numeric call-site IDs
Diffstat (limited to 'backend/unittests')
-rw-r--r--backend/unittests/CodeGen/TargetCallLoweringTest.cpp1
-rw-r--r--backend/unittests/Target/RISCVCallLoweringTest.cpp8
-rw-r--r--backend/unittests/Target/RISCVFrameLoweringTest.cpp2
-rw-r--r--backend/unittests/Target/RISCVLateCodeGenTest.cpp3
4 files changed, 4 insertions, 10 deletions
diff --git a/backend/unittests/CodeGen/TargetCallLoweringTest.cpp b/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
index f826285..c5170d0 100644
--- a/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
+++ b/backend/unittests/CodeGen/TargetCallLoweringTest.cpp
@@ -81,7 +81,6 @@ private:
Description.CallFrame.EmitDestroy = true;
Description.PreservedMask = rcc::test::createTestCallPreservedMask();
Description.Callee = *rcc::MachineCallTarget::externalSymbol("callee");
- Description.CallSiteID = 1;
}
return Description;
}
diff --git a/backend/unittests/Target/RISCVCallLoweringTest.cpp b/backend/unittests/Target/RISCVCallLoweringTest.cpp
index 1eaf146..7284887 100644
--- a/backend/unittests/Target/RISCVCallLoweringTest.cpp
+++ b/backend/unittests/Target/RISCVCallLoweringTest.cpp
@@ -176,7 +176,6 @@ abiValue(rcc::LLT Type, std::uint32_t OriginalValue, rcc::Register Value = plann
Request.Callee = externalTarget();
Request.Arguments = std::move(Arguments);
Request.FixedArgumentCount = FixedArgumentCount;
- Request.CallSiteID = 17;
Request.IsVariadic = IsVariadic;
return Request;
}
@@ -491,14 +490,13 @@ void testOrdinaryAndIndirectEmission(TestContext &Context) {
opcode(rcc::riscv::InstructionOpcode::ADJCALLSTACKDOWN) &&
Instructions[1]->opcode() == rcc::opcode(rcc::GenericOpcode::COPY) &&
Instructions.back()->opcode() == rcc::opcode(rcc::GenericOpcode::COPY) &&
- Call != nullptr && Call->operandCount() >= 6 &&
+ Call != nullptr && Call->operandCount() >= 5 &&
Call->operandAt(0)->kind() == rcc::MachineOperand::Kind::ExternalSymbol &&
Call->operandAt(0)->targetFlags() ==
static_cast<std::uint32_t>(rcc::riscv::CallTargetFlag::DirectCall) &&
- Call->operandAt(1)->kind() == rcc::MachineOperand::Kind::IntegerImmediate &&
- Call->operandAt(2)->kind() == rcc::MachineOperand::Kind::RegisterMask,
+ Call->operandAt(1)->kind() == rcc::MachineOperand::Kind::RegisterMask,
"ordinary emission must materialize canonical full-value copies, call-frame, "
- "target, ID, and RegMask");
+ "target, and RegMask");
const rcc::Register StackPointer =
rcc::Register::fromPhysical(physical(rcc::riscv::PhysicalRegisterID::X2));
const auto HasStackPointerEffects = [StackPointer](const rcc::MachineInstr *Instruction) {
diff --git a/backend/unittests/Target/RISCVFrameLoweringTest.cpp b/backend/unittests/Target/RISCVFrameLoweringTest.cpp
index 95d6a18..0525a6d 100644
--- a/backend/unittests/Target/RISCVFrameLoweringTest.cpp
+++ b/backend/unittests/Target/RISCVFrameLoweringTest.cpp
@@ -391,8 +391,6 @@ buildIndirectTail(rcc::MachineFunction &Function, const rcc::TargetDescription &
return std::unexpected(Pending.error());
if (auto Result = Pending->addUse(Callee); !Result)
return std::unexpected(Result.error());
- if (auto Result = Pending->addImmediate(1); !Result)
- return std::unexpected(Result.error());
if (auto Result = Pending->addRegisterMask(std::move(Mask)); !Result)
return std::unexpected(Result.error());
return Pending->build();
diff --git a/backend/unittests/Target/RISCVLateCodeGenTest.cpp b/backend/unittests/Target/RISCVLateCodeGenTest.cpp
index b9479b2..84ed796 100644
--- a/backend/unittests/Target/RISCVLateCodeGenTest.cpp
+++ b/backend/unittests/Target/RISCVLateCodeGenTest.cpp
@@ -1130,8 +1130,7 @@ void testPostRAPseudoExpansionAndFinalization(TestContext &Context,
}
auto Call = Builder.buildInstr(opcode(rcc::riscv::InstructionOpcode::PseudoCALL));
auto Preserved = rcc::riscv::createCallPreservedMask();
- if (!Call || !Call->addExternalSymbol("callee", 0, 1) || !Call->addImmediate(11) ||
- !Call->addRegisterMask(Preserved) ||
+ if (!Call || !Call->addExternalSymbol("callee", 0, 1) || !Call->addRegisterMask(Preserved) ||
!Call->addImplicitUse(physical(rcc::riscv::PhysicalRegisterID::X10)) || !Call->build()) {
Context.expect(false, "post-RA call pseudo construction must succeed");
return;