LLVM 24.0.0git
RISCVInstructionSelector.cpp File Reference

This file implements the targeting of the InstructionSelector class for RISC-V. More...

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Macros

#define DEBUG_TYPE   "riscv-isel"
#define GET_GLOBALISEL_PREDICATE_BITSET
#define GET_GLOBALISEL_PREDICATES_DECL
#define GET_GLOBALISEL_TEMPORARIES_DECL
#define GET_GLOBALISEL_IMPL
#define GET_GLOBALISEL_PREDICATES_INIT
#define GET_GLOBALISEL_TEMPORARIES_INIT

Functions

static void getOperandsForBranch (Register CondReg, RISCVCC::CondCode &CC, Register &LHS, Register &RHS, MachineRegisterInfo &MRI)
static unsigned selectZalasrLoadStoreOp (unsigned GenericOpc, unsigned OpSize)
 Select the RISC-V Zalasr opcode for the G_LOAD or G_STORE operation GenericOpc, appropriate for the GPR register bank and of memory access size OpSize.
static unsigned selectRegImmLoadStoreOp (const RISCVSubtarget &STI, unsigned GenericOpc, unsigned OpSize)
 Select the RISC-V regimm opcode for the G_LOAD or G_STORE operation GenericOpc on STI, appropriate for the GPR register bank and of memory access size OpSize.
static unsigned getFCmpOpcode (CmpInst::Predicate Pred, unsigned Size)
static bool legalizeFCmpPredicate (Register &LHS, Register &RHS, CmpInst::Predicate &Pred, bool &NeedInvert)
InstructionSelector * llvm::createRISCVInstructionSelector (const RISCVTargetMachine &TM, const RISCVSubtarget &Subtarget, const RISCVRegisterBankInfo &RBI)

Detailed Description

This file implements the targeting of the InstructionSelector class for RISC-V.

Todo
This should be generated by TableGen.

Definition in file RISCVInstructionSelector.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-isel"

Definition at line 28 of file RISCVInstructionSelector.cpp.

◆ GET_GLOBALISEL_IMPL

#define GET_GLOBALISEL_IMPL

Definition at line 207 of file RISCVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATE_BITSET

#define GET_GLOBALISEL_PREDICATE_BITSET

Definition at line 33 of file RISCVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATES_DECL

#define GET_GLOBALISEL_PREDICATES_DECL

Definition at line 196 of file RISCVInstructionSelector.cpp.

◆ GET_GLOBALISEL_PREDICATES_INIT

#define GET_GLOBALISEL_PREDICATES_INIT

◆ GET_GLOBALISEL_TEMPORARIES_DECL

#define GET_GLOBALISEL_TEMPORARIES_DECL

Definition at line 200 of file RISCVInstructionSelector.cpp.

◆ GET_GLOBALISEL_TEMPORARIES_INIT

#define GET_GLOBALISEL_TEMPORARIES_INIT

Function Documentation

◆ getFCmpOpcode()

◆ getOperandsForBranch()

◆ legalizeFCmpPredicate()

◆ selectRegImmLoadStoreOp()

unsigned selectRegImmLoadStoreOp ( const RISCVSubtarget & STI,
unsigned GenericOpc,
unsigned OpSize )
static

Select the RISC-V regimm opcode for the G_LOAD or G_STORE operation GenericOpc on STI, appropriate for the GPR register bank and of memory access size OpSize.

Returns
GenericOpc if the combination is unsupported.

Definition at line 850 of file RISCVInstructionSelector.cpp.

References llvm::RISCVSubtarget::is64Bit().

◆ selectZalasrLoadStoreOp()

unsigned selectZalasrLoadStoreOp ( unsigned GenericOpc,
unsigned OpSize )
static

Select the RISC-V Zalasr opcode for the G_LOAD or G_STORE operation GenericOpc, appropriate for the GPR register bank and of memory access size OpSize.

Definition at line 830 of file RISCVInstructionSelector.cpp.

References llvm_unreachable.