LLVM 22.0.0git
RISCVOptWInstrs.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "riscv-opt-w-instrs"
#define RISCV_OPT_W_INSTRS_NAME   "RISC-V Optimize W Instructions"

Functions

 STATISTIC (NumRemovedSExtW, "Number of removed sign-extensions")
 STATISTIC (NumTransformedToWInstrs, "Number of instructions transformed to W-ops")
 STATISTIC (NumTransformedToNonWInstrs, "Number of instructions transformed to non-W-ops")
 INITIALIZE_PASS (RISCVOptWInstrs, DEBUG_TYPE, RISCV_OPT_W_INSTRS_NAME, false, false) FunctionPass *llvm
static bool vectorPseudoHasAllNBitUsers (const MachineOperand &UserOp, unsigned Bits)
static bool hasAllNBitUsers (const MachineInstr &OrigMI, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI, unsigned OrigBits)
static bool hasAllWUsers (const MachineInstr &OrigMI, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI)
static bool isSignExtendingOpW (const MachineInstr &MI, unsigned OpNo)
static bool isSignExtendedW (Register SrcReg, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI, SmallPtrSetImpl< MachineInstr * > &FixableDef)
static unsigned getWOp (unsigned Opcode)

Variables

static cl::opt< boolDisableSExtWRemoval ("riscv-disable-sextw-removal", cl::desc("Disable removal of sext.w"), cl::init(false), cl::Hidden)
static cl::opt< boolDisableStripWSuffix ("riscv-disable-strip-w-suffix", cl::desc("Disable strip W suffix"), cl::init(false), cl::Hidden)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-opt-w-instrs"

Definition at line 45 of file RISCVOptWInstrs.cpp.

◆ RISCV_OPT_W_INSTRS_NAME

#define RISCV_OPT_W_INSTRS_NAME   "RISC-V Optimize W Instructions"

Definition at line 46 of file RISCVOptWInstrs.cpp.

Referenced by INITIALIZE_PASS().

Function Documentation

◆ getWOp()

unsigned getWOp ( unsigned Opcode)
static

Definition at line 679 of file RISCVOptWInstrs.cpp.

References llvm_unreachable.

◆ hasAllNBitUsers()

◆ hasAllWUsers()

bool hasAllWUsers ( const MachineInstr & OrigMI,
const RISCVSubtarget & ST,
const MachineRegisterInfo & MRI )
static

Definition at line 374 of file RISCVOptWInstrs.cpp.

References hasAllNBitUsers(), and MRI.

Referenced by isSignExtendedW().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( RISCVOptWInstrs ,
DEBUG_TYPE ,
RISCV_OPT_W_INSTRS_NAME ,
false ,
false  )

◆ isSignExtendedW()

◆ isSignExtendingOpW()

bool isSignExtendingOpW ( const MachineInstr & MI,
unsigned OpNo )
static

Definition at line 381 of file RISCVOptWInstrs.cpp.

References assert(), llvm::RISCVII::IsSignExtendingOpWMask, llvm::isUInt(), and MI.

Referenced by isSignExtendedW().

◆ STATISTIC() [1/3]

STATISTIC ( NumRemovedSExtW ,
"Number of removed sign-extensions"  )

◆ STATISTIC() [2/3]

STATISTIC ( NumTransformedToNonWInstrs ,
"Number of instructions transformed to non-W-ops"  )

◆ STATISTIC() [3/3]

STATISTIC ( NumTransformedToWInstrs ,
"Number of instructions transformed to W-ops"  )

◆ vectorPseudoHasAllNBitUsers()

Variable Documentation

◆ DisableSExtWRemoval

cl::opt< bool > DisableSExtWRemoval("riscv-disable-sextw-removal", cl::desc("Disable removal of sext.w"), cl::init(false), cl::Hidden) ( "riscv-disable-sextw-removal" ,
cl::desc("Disable removal of sext.w") ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableStripWSuffix

cl::opt< bool > DisableStripWSuffix("riscv-disable-strip-w-suffix", cl::desc("Disable strip W suffix"), cl::init(false), cl::Hidden) ( "riscv-disable-strip-w-suffix" ,
cl::desc("Disable strip W suffix") ,
cl::init(false) ,
cl::Hidden  )
static