LLVM 19.0.0git
Macros | Functions
SIShrinkInstructions.cpp File Reference
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"

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.
 

Functions

 STATISTIC (NumInstructionsShrunk, "Number of 64-bit instruction reduced to 32-bit.")
 
 STATISTIC (NumLiteralConstantsFolded, "Number of literal constants folded into 32-bit instructions.")
 
static unsigned canModifyToInlineImmOp32 (const SIInstrInfo *TII, const MachineOperand &Src, int32_t &ModifiedImm, bool Scalar)
 

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 18 of file SIShrinkInstructions.cpp.

Function Documentation

◆ canModifyToInlineImmOp32()

static unsigned canModifyToInlineImmOp32 ( const SIInstrInfo TII,
const MachineOperand Src,
int32_t &  ModifiedImm,
bool  Scalar 
)
static
Returns
the opcode of an instruction a move immediate of the constant Src can be replaced with if the constant is replaced with ModifiedImm. i.e.

If the bitreverse of a constant is an inline immediate, reverse the immediate and return the bitreverse opcode.

If the bitwise negation of a constant is an inline immediate, reverse the immediate and return the bitwise not opcode.

Definition at line 194 of file SIShrinkInstructions.cpp.

References TII.

◆ 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."   
)