diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 13:21:44 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-13 13:21:44 +0800 |
| commit | 9f7cd14951ed9b7e04176f68f5c454aa7018b3e3 (patch) | |
| tree | dba38b5a5f75203d10972ff81754ef76c9bb8857 /backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp | |
| parent | 8558f80b4077536d6aa46b97328d6df1210e261f (diff) | |
| download | rcc-project-9f7cd14951ed9b7e04176f68f5c454aa7018b3e3.tar.gz rcc-project-9f7cd14951ed9b7e04176f68f5c454aa7018b3e3.tar.xz | |
[RISCV] Use the generated opcode conversion
Diffstat (limited to 'backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp')
| -rw-r--r-- | backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp index da8d687..541af2b 100644 --- a/backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp +++ b/backend/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp @@ -31,10 +31,6 @@ namespace rcc::riscv { namespace { -[[nodiscard]] Opcode targetOpcode(InstructionOpcode Value) noexcept { - return Opcode::fromValue(static_cast<std::uint32_t>(Value)); -} - [[nodiscard]] std::optional<LLT> registerType(const MachineFunction &Function, const MachineOperand &Operand) { const Register *Reg = Operand.getIf<Register>(); @@ -943,7 +939,7 @@ lowerAtomicCompareExchangeWithSuccess(MachineInstr &Instruction, MachineFunction Amount = *MaskedAmount; } auto SetOpcode = - Extension.setOpcode(Plan->SourceWidth == 32 ? targetOpcode(InstructionOpcode::G_SLLW) + Extension.setOpcode(Plan->SourceWidth == 32 ? instructionOpcode(InstructionOpcode::G_SLLW) : opcode(GenericOpcode::G_SHL)); if (!SetOpcode) return std::unexpected(SetOpcode.error()); |
