LLVM: lib/Target/X86/X86OptimizeLEAs.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
Macros
#define DEBUG_TYPE "x86-optimize-LEAs"
Functions
STATISTIC (NumSubstLEAs, "Number of LEA instruction substitutions")
STATISTIC (NumRedundantLEAs, "Number of redundant LEA instructions removed")
static bool isIdenticalOp (const MachineOperand &MO1, const MachineOperand &MO2)
Returns true if two machine operands are identical and they are not physical registers.
static bool isSimilarDispOp (const MachineOperand &MO1, const MachineOperand &MO2)
Returns true if two address displacement operands are of the same type and use the same symbol/index/address regardless of the offset.
static bool isLEA (const MachineInstr &MI)
Returns true if the instruction is LEA.
static MemOpKey getMemOpKey (const MachineInstr &MI, unsigned N)
Returns a hash table key based on memory operands of MI.
static bool isValidDispOp (const MachineOperand &MO)
INITIALIZE_PASS (X86OptimizeLEAPass, DEBUG_TYPE, "X86 optimize LEA pass", false, false) int X86OptimizeLEAPass

DEBUG_TYPE

#define DEBUG_TYPE "x86-optimize-LEAs"

getMemOpKey()

INITIALIZE_PASS()

INITIALIZE_PASS ( X86OptimizeLEAPass ,
DEBUG_TYPE ,
"X86 optimize LEA pass" ,
false ,
false )

isIdenticalOp()

isLEA()

isSimilarDispOp()

Returns true if two address displacement operands are of the same type and use the same symbol/index/address regardless of the offset.

Definition at line 213 of file X86OptimizeLEAs.cpp.

References assert(), llvm::MachineOperand::getBlockAddress(), llvm::MachineOperand::getGlobal(), llvm::MachineOperand::getIndex(), llvm::MachineOperand::getMBB(), llvm::MachineOperand::getMCSymbol(), llvm::MachineOperand::getSymbolName(), llvm::MachineOperand::isBlockAddress(), llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isJTI(), llvm::MachineOperand::isMBB(), llvm::MachineOperand::isMCSymbol(), llvm::MachineOperand::isSymbol(), and isValidDispOp().

isValidDispOp()

STATISTIC() [1/2]

STATISTIC ( NumRedundantLEAs ,
"Number of redundant LEA instructions removed" )

STATISTIC() [2/2]

STATISTIC ( NumSubstLEAs ,
"Number of LEA instruction substitutions" )

DisableX86LEAOpt

cl::opt< bool > DisableX86LEAOpt("disable-x86-lea-opt", cl::Hidden, cl::desc("X86: Disable LEA optimizations."), cl::init(false)) ( "disable-x86-lea-opt" , cl::Hidden , cl::desc("X86: Disable LEA optimizations.") , cl::init(false) ) static