LLVM 22.0.0git
SIShrinkInstructions.cpp File Reference

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

Function Documentation

◆ canModifyToInlineImmOp32()

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

References llvm::reverseBits(), and 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."  )

References I, MI, MRI, Reg, llvm::Sub, SubReg, TII, and TRI.