LLVM 22.0.0git
LoongArchOptWInstrs.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loongarch-opt-w-instrs"
#define LOONGARCH_OPT_W_INSTRS_NAME   "LoongArch Optimize W Instructions"

Functions

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

Variables

static cl::opt< boolDisableSExtWRemoval ("loongarch-disable-sextw-removal", cl::desc("Disable removal of sign-extend insn"), cl::init(false), cl::Hidden)
static cl::opt< boolDisableCvtToDSuffix ("loongarch-disable-cvt-to-d-suffix", cl::desc("Disable convert to D suffix"), cl::init(false), cl::Hidden)

Macro Definition Documentation

◆ DEBUG_TYPE

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

Definition at line 42 of file LoongArchOptWInstrs.cpp.

◆ LOONGARCH_OPT_W_INSTRS_NAME

#define LOONGARCH_OPT_W_INSTRS_NAME   "LoongArch Optimize W Instructions"

Definition at line 43 of file LoongArchOptWInstrs.cpp.

Referenced by INITIALIZE_PASS().

Function Documentation

◆ getWOp()

unsigned getWOp ( unsigned Opcode)
static

Definition at line 692 of file LoongArchOptWInstrs.cpp.

References llvm_unreachable.

◆ hasAllNBitUsers()

◆ hasAllWUsers()

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

Definition at line 345 of file LoongArchOptWInstrs.cpp.

References hasAllNBitUsers(), and MRI.

Referenced by isSignExtendedW().

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( LoongArchOptWInstrs ,
DEBUG_TYPE ,
LOONGARCH_OPT_W_INSTRS_NAME ,
false ,
false  )

◆ isSignExtendedW()

◆ isSignExtendingOpW()

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

Definition at line 353 of file LoongArchOptWInstrs.cpp.

References MI, and MRI.

Referenced by isSignExtendedW().

◆ STATISTIC() [1/2]

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

◆ STATISTIC() [2/2]

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

Variable Documentation

◆ DisableCvtToDSuffix

cl::opt< bool > DisableCvtToDSuffix("loongarch-disable-cvt-to-d-suffix", cl::desc("Disable convert to D suffix"), cl::init(false), cl::Hidden) ( "loongarch-disable-cvt-to-d-suffix" ,
cl::desc("Disable convert to D suffix") ,
cl::init(false) ,
cl::Hidden  )
static

◆ DisableSExtWRemoval

cl::opt< bool > DisableSExtWRemoval("loongarch-disable-sextw-removal", cl::desc("Disable removal of sign-extend insn"), cl::init(false), cl::Hidden) ( "loongarch-disable-sextw-removal" ,
cl::desc("Disable removal of sign-extend insn") ,
cl::init(false) ,
cl::Hidden  )
static