LLVM  6.0.0svn
Namespaces | Macros | Functions
X86FixupLEAs.cpp File Reference
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
Include dependency graph for X86FixupLEAs.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

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

Functions

void llvm::initializeFixupLEAPassPass (PassRegistry &)
 
 STATISTIC (NumLEAs, "Number of LEA instructions created")
 
static bool getPreviousInstr (MachineBasicBlock::iterator &I, MachineFunction::iterator MFI)
 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. More...
 
static bool isLEA (const int Opcode)
 
static bool isInefficientLEAReg (unsigned int Reg)
 
static bool isRegOperand (const MachineOperand &Op)
 
static bool hasInefficientLEABaseReg (const MachineOperand &Base, const MachineOperand &Index)
 hasIneffecientLEARegs - LEA that uses base and index registers where the base is EBP, RBP, or R13 More...
 
static bool hasLEAOffset (const MachineOperand &Offset)
 
static bool isThreeOperandsLEA (const MachineOperand &Base, const MachineOperand &Index, const MachineOperand &Offset)
 
static int getADDrrFromLEA (int LEAOpcode)
 
static int getADDriFromLEA (int LEAOpcode, const MachineOperand &Offset)
 
static bool isLEASimpleIncOrDec (MachineInstr &LEA)
 isLEASimpleIncOrDec - Does this LEA have one these forms: lea reg, 1(reg) lea reg, -1(reg) More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   FIXUPLEA_NAME

Definition at line 37 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_DESC

#define FIXUPLEA_DESC   "X86 LEA Fixup"

Definition at line 34 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_NAME

#define FIXUPLEA_NAME   "x86-fixup-LEAs"

Definition at line 35 of file X86FixupLEAs.cpp.

Function Documentation

◆ getADDriFromLEA()

static int getADDriFromLEA ( int  LEAOpcode,
const MachineOperand Offset 
)
inlinestatic

◆ getADDrrFromLEA()

static int getADDrrFromLEA ( int  LEAOpcode)
inlinestatic

Definition at line 307 of file X86FixupLEAs.cpp.

References llvm_unreachable.

Referenced by isLEASimpleIncOrDec().

◆ getPreviousInstr()

static bool getPreviousInstr ( MachineBasicBlock::iterator I,
MachineFunction::iterator  MFI 
)
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 238 of file X86FixupLEAs.cpp.

References llvm::HexagonInstrInfo::getInstrLatency(), I, and TII.

◆ hasInefficientLEABaseReg()

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

hasIneffecientLEARegs - LEA that uses base and index registers where the base is EBP, RBP, or R13

Definition at line 290 of file X86FixupLEAs.cpp.

References llvm::MachineOperand::getReg(), isInefficientLEAReg(), llvm::MachineOperand::isReg(), and isRegOperand().

Referenced by isLEASimpleIncOrDec().

◆ hasLEAOffset()

static bool hasLEAOffset ( const MachineOperand Offset)
inlinestatic

◆ isInefficientLEAReg()

static bool isInefficientLEAReg ( unsigned int  Reg)
inlinestatic

Definition at line 281 of file X86FixupLEAs.cpp.

Referenced by hasInefficientLEABaseReg(), and isLEASimpleIncOrDec().

◆ isLEA()

static bool isLEA ( const int  Opcode)
inlinestatic

Definition at line 276 of file X86FixupLEAs.cpp.

Referenced by isLEASimpleIncOrDec().

◆ isLEASimpleIncOrDec()

static bool isLEASimpleIncOrDec ( MachineInstr LEA)
inlinestatic

◆ isRegOperand()

static bool isRegOperand ( const MachineOperand Op)
inlinestatic

◆ isThreeOperandsLEA()

static bool isThreeOperandsLEA ( const MachineOperand Base,
const MachineOperand Index,
const MachineOperand Offset 
)
inlinestatic

Definition at line 301 of file X86FixupLEAs.cpp.

References hasLEAOffset(), and isRegOperand().

Referenced by isLEASimpleIncOrDec().

◆ STATISTIC()

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