From cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Tue, 11 Aug 2026 20:16:09 +0800 Subject: [CodeGen] Remove redundant numeric call-site IDs --- backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp') diff --git a/backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp b/backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp index 8a309e0..ae5e51d 100644 --- a/backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp +++ b/backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp @@ -338,9 +338,8 @@ copyRegisters(const MachineInstr &Instruction) { const TargetDescription &Target, bool IsTail) { MachineBasicBlock *Block = Instruction.parent(); const MachineOperand *Callee = Instruction.operandAt(0); - const MachineOperand *CallSite = Instruction.operandAt(1); - const MachineOperand *Mask = Instruction.operandAt(2); - if (Block == nullptr || Callee == nullptr || CallSite == nullptr || Mask == nullptr || + const MachineOperand *Mask = Instruction.operandAt(1); + if (Block == nullptr || Callee == nullptr || Mask == nullptr || Mask->kind() != MachineOperand::Kind::RegisterMask) { return makeUnexpected(ErrorCode::VerificationError, "RISC-V call pseudo has malformed explicit operands"); @@ -409,14 +408,11 @@ copyRegisters(const MachineInstr &Instruction) { Anchor ? LowPending->addMCSymbol(*Anchor, 0, PCRelativeLowFlag) : LowPending->addImmediate(0); if (!LowOffset) return std::unexpected(LowOffset.error()); - auto LowCallSite = LowPending->addOperand(CallSite->cloneDetached()); - if (!LowCallSite) - return std::unexpected(LowCallSite.error()); auto LowMask = LowPending->addOperand(Mask->cloneDetached()); if (!LowMask) return std::unexpected(LowMask.error()); auto Implicit = copyExtraImplicitOperands( - Instruction, 3, *LowPending, IsTail ? std::nullopt : std::optional{*Link}, + Instruction, 2, *LowPending, IsTail ? std::nullopt : std::optional{*Link}, std::nullopt); if (!Implicit) return std::unexpected(Implicit.error()); -- cgit v1.2.3