LLVM  6.0.0svn
Macros | Functions
SIShrinkInstructions.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUMCInstLower.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
Include dependency graph for SIShrinkInstructions.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-shrink-instructions"
 The pass tries to use the 32-bit encoding for instructions when possible. More...
 

Functions

 STATISTIC (NumInstructionsShrunk, "Number of 64-bit instruction reduced to 32-bit.")
 
 STATISTIC (NumLiteralConstantsFolded, "Number of literal constants folded into 32-bit instructions.")
 
static bool isVGPR (const MachineOperand *MO, const SIRegisterInfo &TRI, const MachineRegisterInfo &MRI)
 
static bool canShrink (MachineInstr &MI, const SIInstrInfo *TII, const SIRegisterInfo &TRI, const MachineRegisterInfo &MRI)
 
static bool foldImmediates (MachineInstr &MI, const SIInstrInfo *TII, MachineRegisterInfo &MRI, bool TryToCommute=true)
 This function checks MI for operands defined by a move immediate instruction and then folds the literal constant into the instruction if it can. More...
 
static void copyFlagsToImplicitVCC (MachineInstr &MI, const MachineOperand &Orig)
 
static bool isKImmOperand (const SIInstrInfo *TII, const MachineOperand &Src)
 
static bool isKUImmOperand (const SIInstrInfo *TII, const MachineOperand &Src)
 
static bool isKImmOrKUImmOperand (const SIInstrInfo *TII, const MachineOperand &Src, bool &IsUnsigned)
 
static bool isReverseInlineImm (const SIInstrInfo *TII, const MachineOperand &Src, int32_t &ReverseImm)
 
static void copyExtraImplicitOps (MachineInstr &NewMI, MachineFunction &MF, const MachineInstr &MI)
 Copy implicit register operands from specified instruction to this instruction that are not part of the instruction definition. More...
 
static void shrinkScalarCompare (const SIInstrInfo *TII, MachineInstr &MI)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-shrink-instructions"

The pass tries to use the 32-bit encoding for instructions when possible.

Definition at line 27 of file SIShrinkInstructions.cpp.

Function Documentation

◆ canShrink()

static bool canShrink ( MachineInstr MI,
const SIInstrInfo TII,
const SIRegisterInfo TRI,
const MachineRegisterInfo MRI 
)
static

◆ copyExtraImplicitOps()

static void copyExtraImplicitOps ( MachineInstr NewMI,
MachineFunction MF,
const MachineInstr MI 
)
static

◆ copyFlagsToImplicitVCC()

static void copyFlagsToImplicitVCC ( MachineInstr MI,
const MachineOperand Orig 
)
static

◆ foldImmediates()

static bool foldImmediates ( MachineInstr MI,
const SIInstrInfo TII,
MachineRegisterInfo MRI,
bool  TryToCommute = true 
)
static

◆ isKImmOperand()

static bool isKImmOperand ( const SIInstrInfo TII,
const MachineOperand Src 
)
static

◆ isKImmOrKUImmOperand()

static bool isKImmOrKUImmOperand ( const SIInstrInfo TII,
const MachineOperand Src,
bool IsUnsigned 
)
static

◆ isKUImmOperand()

static bool isKUImmOperand ( const SIInstrInfo TII,
const MachineOperand Src 
)
static

◆ isReverseInlineImm()

static bool isReverseInlineImm ( const SIInstrInfo TII,
const MachineOperand Src,
int32_t &  ReverseImm 
)
static
Returns
true if the constant in Src should be replaced with a bitreverse of an inline immediate.

Definition at line 226 of file SIShrinkInstructions.cpp.

References llvm::MachineOperand::getImm(), llvm::SIInstrInfo::isInlineConstant(), and llvm::isInt< 32 >().

Referenced by shrinkScalarCompare().

◆ isVGPR()

static bool isVGPR ( const MachineOperand MO,
const SIRegisterInfo TRI,
const MachineRegisterInfo MRI 
)
static

◆ shrinkScalarCompare()

static void shrinkScalarCompare ( const SIInstrInfo TII,
MachineInstr MI 
)
static

◆ STATISTIC() [1/2]

STATISTIC ( NumInstructionsShrunk  ,
"Number of 64-bit instruction reduced to 32-bit."   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumLiteralConstantsFolded  ,
"Number of literal constants folded into 32-bit instructions."   
)