LLVM 24.0.0git
X86FixupLEAs.cpp File Reference

Go to the source code of this file.

Macros

#define FIXUPLEA_DESC   "X86 LEA Fixup"
#define FIXUPLEA_NAME   "x86-fixup-leas"
#define DEBUG_TYPE   FIXUPLEA_NAME

Functions

 STATISTIC (NumLEAs, "Number of LEA instructions created")
static bool isLEA (unsigned Opcode)
static bool getPreviousInstr (MachineBasicBlock::iterator &I, MachineBasicBlock &MBB)
 getPreviousInstr - Given a reference to an instruction in a basic block, return a reference to the previous instruction in the block, wrapping around to the last instruction of the block if the block branches to itself.
static bool isInefficientLEAReg (Register Reg)
static bool hasInefficientLEABaseReg (const MachineOperand &Base, const MachineOperand &Index)
 Returns true if this LEA uses base and index registers, and the base register is known to be inefficient for the subtarget.
static bool mayHaveOffset (const MachineOperand &Offset)
static unsigned getADDrrFromLEA (unsigned LEAOpcode)
static unsigned getSUBrrFromLEA (unsigned LEAOpcode)
static unsigned getADDriFromLEA (unsigned LEAOpcode, const MachineOperand &Offset)
static unsigned getSUBriFromLEA (unsigned LEAOpcode)
static unsigned getINCDECFromLEA (unsigned LEAOpcode, bool IsINC)

Variables

static cl::opt< unsigned > SearchALUInstrDistanceThreshold ("x86-fixup-leas-search-distance-threshold", cl::Hidden, cl::desc("Maximum instruction distance when searching for an ADD or SUB " "after a LEA"), cl::init(5))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   FIXUPLEA_NAME

Definition at line 34 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_DESC

#define FIXUPLEA_DESC   "X86 LEA Fixup"

Definition at line 31 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_NAME

#define FIXUPLEA_NAME   "x86-fixup-leas"

Definition at line 32 of file X86FixupLEAs.cpp.

Function Documentation

◆ getADDriFromLEA()

unsigned getADDriFromLEA ( unsigned LEAOpcode,
const MachineOperand & Offset )
inlinestatic

Definition at line 382 of file X86FixupLEAs.cpp.

References llvm_unreachable, and llvm::Offset.

◆ getADDrrFromLEA()

unsigned getADDrrFromLEA ( unsigned LEAOpcode)
inlinestatic

Definition at line 358 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ getINCDECFromLEA()

unsigned getINCDECFromLEA ( unsigned LEAOpcode,
bool IsINC )
inlinestatic

Definition at line 407 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ getPreviousInstr()

bool getPreviousInstr ( MachineBasicBlock::iterator & I,
MachineBasicBlock & MBB )
inlinestatic

getPreviousInstr - Given a reference to an instruction in a basic block, return a reference to the previous instruction in the block, wrapping around to the last instruction of the block if the block branches to itself.

Definition at line 302 of file X86FixupLEAs.cpp.

References I, and MBB.

◆ getSUBriFromLEA()

unsigned getSUBriFromLEA ( unsigned LEAOpcode)
inlinestatic

Definition at line 395 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ getSUBrrFromLEA()

unsigned getSUBrrFromLEA ( unsigned LEAOpcode)
inlinestatic

Definition at line 370 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ hasInefficientLEABaseReg()

bool hasInefficientLEABaseReg ( const MachineOperand & Base,
const MachineOperand & Index )
inlinestatic

Returns true if this LEA uses base and index registers, and the base register is known to be inefficient for the subtarget.

Definition at line 347 of file X86FixupLEAs.cpp.

References llvm::sampleprof::Base, and isInefficientLEAReg().

◆ isInefficientLEAReg()

bool isInefficientLEAReg ( Register Reg)
inlinestatic

Definition at line 338 of file X86FixupLEAs.cpp.

References Reg.

Referenced by hasInefficientLEABaseReg().

◆ isLEA()

bool isLEA ( unsigned Opcode)
static

Definition at line 234 of file X86FixupLEAs.cpp.

Referenced by llvm::X86InstrInfo::isDataInvariant().

◆ mayHaveOffset()

bool mayHaveOffset ( const MachineOperand & Offset)
inlinestatic

Definition at line 354 of file X86FixupLEAs.cpp.

References llvm::Offset.

◆ STATISTIC()

STATISTIC ( NumLEAs ,
"Number of LEA instructions created"  )

Variable Documentation

◆ SearchALUInstrDistanceThreshold

cl::opt< unsigned > SearchALUInstrDistanceThreshold("x86-fixup-leas-search-distance-threshold", cl::Hidden, cl::desc("Maximum instruction distance when searching for an ADD or SUB " "after a LEA"), cl::init(5)) ( "x86-fixup-leas-search-distance-threshold" ,
cl::Hidden ,
cl::desc("Maximum instruction distance when searching for an ADD or SUB " "after a LEA") ,
cl::init(5)  )
static