LLVM  17.0.0git
Macros | Functions | Variables
RISCVSExtWRemoval.cpp File Reference
#include "RISCV.h"
#include "RISCVMachineFunctionInfo.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 bool isSignExtendingOpW (const MachineInstr &MI, const MachineRegisterInfo &MRI)
 
static bool isSignExtendedW (Register SrcReg, const MachineRegisterInfo &MRI, const RISCVInstrInfo &TII, 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 24 of file RISCVSExtWRemoval.cpp.

Function Documentation

◆ getWOp()

static unsigned getWOp ( unsigned  Opcode)
static

◆ INITIALIZE_PASS()

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

Definition at line 56 of file RISCVSExtWRemoval.cpp.

◆ isSignExtendedW()

static bool isSignExtendedW ( Register  SrcReg,
const MachineRegisterInfo MRI,
const RISCVInstrInfo TII,
SmallPtrSetImpl< MachineInstr * > &  FixableDef 
)
static

◆ isSignExtendingOpW()

static bool isSignExtendingOpW ( const MachineInstr MI,
const MachineRegisterInfo MRI 
)
static

Definition at line 65 of file RISCVSExtWRemoval.cpp.

References llvm::RISCVII::IsSignExtendingOpWMask, MI, and TSFlags.

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

◆ DisableSExtWRemoval

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