aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-17 03:16:26 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-17 03:16:26 +0800
commitf5c592905e6e1ef4b78337d76c8215e543607b8d (patch)
tree193400315338b57af33699ad7f952fb3731b3a65 /backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
parent9720e989ccdce77a2c45a8379d36ff4428e6c2bf (diff)
downloadrcc-project-f5c592905e6e1ef4b78337d76c8215e543607b8d.tar.gz
rcc-project-f5c592905e6e1ef4b78337d76c8215e543607b8d.tar.xz
[RISCV][GlobalISel] Generate conditional branch selection
Diffstat (limited to 'backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp')
-rw-r--r--backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp b/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
index 89b6ecd..1e2eb92 100644
--- a/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
+++ b/backend/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
@@ -364,7 +364,6 @@ public:
case GenericOpcode::G_FPEXTLOAD:
case GenericOpcode::G_FPTRUNCSTORE:
case GenericOpcode::G_STORE:
- case GenericOpcode::G_BRCOND:
return {};
case GenericOpcode::G_FCONSTANT: {
const MachineOperand *Immediate = Instruction.operandAt(1);
@@ -440,8 +439,6 @@ public:
return selectStore(Instruction, Function);
case GenericOpcode::G_FPTRUNCSTORE:
return selectFloatTruncStore(Instruction, Function, Target);
- case GenericOpcode::G_BRCOND:
- return selectConditionalBranch(Instruction);
case GenericOpcode::G_CONSTANT:
return selectIntegerConstant(Instruction, Function, Target, Type);
case GenericOpcode::G_FCONSTANT:
@@ -1422,16 +1419,6 @@ private:
return makeUnexpected(ErrorCode::Unsupported, "RISC-V cannot select this generic store type");
}
- [[nodiscard]] Expected<void> selectConditionalBranch(MachineInstr &Instruction) const {
- auto Zero = physicalRegister(PhysicalRegisterID::X0);
- if (!Zero)
- return std::unexpected(Zero.error());
- auto Inserted = insertPhysicalRegister(Instruction, 1, *Zero, RegisterOperandFlag::Use);
- if (!Inserted)
- return std::unexpected(Inserted.error());
- return Instruction.setOpcode(instructionOpcode(InstructionOpcode::BNE));
- }
-
[[nodiscard]] Expected<void> selectIntegerConstant(MachineInstr &Instruction,
MachineFunction &Function,
const TargetDescription &Target,