LLVM  8.0.0svn
Macros | Enumerations | Functions
MicroMipsSizeReduction.cpp File Reference

This pass is used to reduce the size of instructions where applicable. More...

#include "Mips.h"
#include "MipsInstrInfo.h"
#include "MipsSubtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Support/Debug.h"
Include dependency graph for MicroMipsSizeReduction.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "micromips-reduce-size"
#define MICROMIPS_SIZE_REDUCE_NAME   "MicroMips instruction size reduce pass"


enum  OperandTransfer
 Order of operands to transfer. More...
enum  ReduceType
 Reduction type. More...


 STATISTIC (NumReduced, "Number of instructions reduced (32-bit to 16-bit ones, " "or two instructions into one")
 INITIALIZE_PASS (MicroMipsSizeReduce, DEBUG_TYPE, MICROMIPS_SIZE_REDUCE_NAME, false, false) static bool IsSP(const MachineOperand &MO)
static bool isMMThreeBitGPRegister (const MachineOperand &MO)
static bool isMMSourceRegister (const MachineOperand &MO)
static bool GetImm (MachineInstr *MI, unsigned Op, int64_t &Imm)
static bool AddiuspImmValue (int64_t Value)
static bool InRange (int64_t Value, unsigned short Shift, int LBound, int HBound)
static bool ImmInRange (MachineInstr *MI, const ReduceEntry &Entry)
static bool CheckXWPInstr (MachineInstr *MI, bool ReduceToLwp, const ReduceEntry &Entry)
static bool ConsecutiveRegisters (unsigned Reg1, unsigned Reg2)
static bool ConsecutiveInstr (MachineInstr *MI1, MachineInstr *MI2)

Detailed Description

This pass is used to reduce the size of instructions where applicable.

TODO: Implement microMIPS64 support.

Definition in file MicroMipsSizeReduction.cpp.

Macro Definition Documentation


#define DEBUG_TYPE   "micromips-reduce-size"

Definition at line 23 of file MicroMipsSizeReduction.cpp.


#define MICROMIPS_SIZE_REDUCE_NAME   "MicroMips instruction size reduce pass"

Definition at line 24 of file MicroMipsSizeReduction.cpp.

Enumeration Type Documentation

◆ OperandTransfer

Order of operands to transfer.

Definition at line 33 of file MicroMipsSizeReduction.cpp.

◆ ReduceType

enum ReduceType

Reduction type.

Definition at line 45 of file MicroMipsSizeReduction.cpp.

Function Documentation

◆ AddiuspImmValue()

static bool AddiuspImmValue ( int64_t  Value)

Definition at line 311 of file MicroMipsSizeReduction.cpp.

◆ CheckXWPInstr()

static bool CheckXWPInstr ( MachineInstr MI,
bool  ReduceToLwp,
const ReduceEntry &  Entry 

◆ ConsecutiveInstr()

static bool ConsecutiveInstr ( MachineInstr MI1,
MachineInstr MI2 

◆ ConsecutiveRegisters()

static bool ConsecutiveRegisters ( unsigned  Reg1,
unsigned  Reg2 

Definition at line 372 of file MicroMipsSizeReduction.cpp.

References RA, llvm::SmallVectorBase::size(), T1, and llvm::X86II::T8.

Referenced by ConsecutiveInstr().

◆ GetImm()

static bool GetImm ( MachineInstr MI,
unsigned  Op,
int64_t &  Imm 

◆ ImmInRange()

static bool ImmInRange ( MachineInstr MI,
const ReduceEntry &  Entry 

Definition at line 331 of file MicroMipsSizeReduction.cpp.

References GetImm(), and InRange().

Referenced by CheckXWPInstr().


INITIALIZE_PASS ( MicroMipsSizeReduce  ,
false  ,
) const &

Definition at line 276 of file MicroMipsSizeReduction.cpp.

◆ InRange()

static bool InRange ( int64_t  Value,
unsigned short  Shift,
int  LBound,
int  HBound 

Definition at line 321 of file MicroMipsSizeReduction.cpp.

Referenced by llvm::ConstantFoldGetElementPtr(), and ImmInRange().

◆ isMMSourceRegister()

static bool isMMSourceRegister ( const MachineOperand MO)

◆ isMMThreeBitGPRegister()

static bool isMMThreeBitGPRegister ( const MachineOperand MO)


STATISTIC ( NumReduced  )