LLVM API Documentation

Namespaces | Defines | Functions | Variables
SIShrinkInstructions.cpp File Reference
#include "AMDGPU.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/LLVMContext.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetMachine.h"
Include dependency graph for SIShrinkInstructions.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm
 

List of target independent CodeGen pass IDs.


Defines

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

Functions

 STATISTIC (NumInstructionsShrunk,"Number of 64-bit instruction reduced to 32-bit.")
 STATISTIC (NumLiteralConstantsFolded,"Number of literal constants folded into 32-bit instructions.")
void llvm::initializeSIShrinkInstructionsPass (PassRegistry &)
 INITIALIZE_PASS_BEGIN (SIShrinkInstructions, DEBUG_TYPE,"SI Lower il Copies", false, false) INITIALIZE_PASS_END(SIShrinkInstructions
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 void 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. This function assumes that MI is a VOP1, VOP2, or VOPC instruction and will only fold literal constants if we are still in SSA.

Variables

 DEBUG_TYPE
SI Lower il Copies
SI Lower il false

Define Documentation

#define DEBUG_TYPE   "si-shrink-instructions"

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

Definition at line 25 of file SIShrinkInstructions.cpp.


Function Documentation

static bool canShrink ( MachineInstr MI,
const SIInstrInfo TII,
const SIRegisterInfo TRI,
const MachineRegisterInfo MRI 
) [static]
static void foldImmediates ( MachineInstr MI,
const SIInstrInfo TII,
MachineRegisterInfo MRI,
bool  TryToCommute = true 
) [static]
INITIALIZE_PASS_BEGIN ( SIShrinkInstructions  ,
DEBUG_TYPE  ,
"SI Lower il Copies ,
false  ,
false   
)
static bool isVGPR ( const MachineOperand MO,
const SIRegisterInfo TRI,
const MachineRegisterInfo MRI 
) [static]
STATISTIC ( NumInstructionsShrunk  ,
"Number of 64-bit instruction reduced to 32-bit."   
)
STATISTIC ( NumLiteralConstantsFolded  ,
"Number of literal constants folded into 32-bit instructions."   
)

Variable Documentation

SI Lower il Copies

Definition at line 64 of file SIShrinkInstructions.cpp.

Definition at line 64 of file SIShrinkInstructions.cpp.

SI Lower il false

Definition at line 64 of file SIShrinkInstructions.cpp.