diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-11 20:16:09 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-11 20:16:09 +0800 |
| commit | cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9 (patch) | |
| tree | dffd656415955f1cc7431e790bec6b4e3c7b58ef /backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp | |
| parent | d53149886f39884efe3da5cae67653f9f86132d6 (diff) | |
| download | rcc-project-cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9.tar.gz rcc-project-cd2e88b9618ba7c2f6fcfac901e81f4a302a34c9.tar.xz | |
[CodeGen] Remove redundant numeric call-site IDs
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp')
| -rw-r--r-- | backend/lib/Target/RISCV/RISCVPseudoExpansion.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
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<PhysicalRegister>{*Link}, + Instruction, 2, *LowPending, IsTail ? std::nullopt : std::optional<PhysicalRegister>{*Link}, std::nullopt); if (!Implicit) return std::unexpected(Implicit.error()); |
