LLVM  15.0.0git
Macros | Functions | Variables
RISCVSExtWRemoval.cpp File Reference
#include "RISCV.h"
#include "RISCVSubtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
Include dependency graph for RISCVSExtWRemoval.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "riscv-sextw-removal"
 

Functions

 STATISTIC (NumRemovedSExtW, "Number of removed sign-extensions")
 
 STATISTIC (NumTransformedToWInstrs, "Number of instructions transformed to W-ops")
 
 INITIALIZE_PASS (RISCVSExtWRemoval, DEBUG_TYPE, "RISCV sext.w Removal", false, false) FunctionPass *llvm
 
static void addUses (const MachineInstr &MI, SmallVectorImpl< const MachineInstr * > &Worklist, MachineRegisterInfo &MRI)
 
static bool isAllUsesReadW (const MachineInstr &OrigMI, MachineRegisterInfo &MRI)
 
static bool isSignExtendingOpW (MachineInstr &MI, MachineRegisterInfo &MRI, SmallPtrSetImpl< MachineInstr * > &FixableDef)
 
static bool isSignExtendedW (MachineInstr &OrigMI, MachineRegisterInfo &MRI, SmallPtrSetImpl< MachineInstr * > &FixableDef)
 
static unsigned getWOp (unsigned Opcode)
 

Variables

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

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-sextw-removal"

Definition at line 21 of file RISCVSExtWRemoval.cpp.

Function Documentation

◆ addUses()

static void addUses ( const MachineInstr MI,
SmallVectorImpl< const MachineInstr * > &  Worklist,
MachineRegisterInfo MRI 
)
static

Definition at line 61 of file RISCVSExtWRemoval.cpp.

References MI, MRI, and llvm::MachineRegisterInfo::reg_operands().

Referenced by isAllUsesReadW().

◆ getWOp()

static unsigned getWOp ( unsigned  Opcode)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( RISCVSExtWRemoval  ,
DEBUG_TYPE  ,
"RISCV sext.w Removal ,
false  ,
false   
)

Definition at line 53 of file RISCVSExtWRemoval.cpp.

◆ isAllUsesReadW()

static bool isAllUsesReadW ( const MachineInstr OrigMI,
MachineRegisterInfo MRI 
)
static

◆ isSignExtendedW()

static bool isSignExtendedW ( MachineInstr OrigMI,
MachineRegisterInfo MRI,
SmallPtrSetImpl< MachineInstr * > &  FixableDef 
)
static

◆ isSignExtendingOpW()

static bool isSignExtendingOpW ( MachineInstr MI,
MachineRegisterInfo MRI,
SmallPtrSetImpl< MachineInstr * > &  FixableDef 
)
static

◆ STATISTIC() [1/2]

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

◆ STATISTIC() [2/2]

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

Variable Documentation

◆ DisableSExtWRemoval

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