LLVM  14.0.0git
Macros | Functions
X86FixupLEAs.cpp File Reference
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/CodeGen/LazyMachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineSizeOpts.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetSchedule.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Include dependency graph for X86FixupLEAs.cpp:

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. More...
 
static bool isInefficientLEAReg (unsigned Reg)
 
static bool hasInefficientLEABaseReg (const MachineOperand &Base, const MachineOperand &Index)
 Returns true if this LEA uses base an index registers, and the base register is known to be inefficient for the subtarget. More...
 
static bool hasLEAOffset (const MachineOperand &Offset)
 
static unsigned getADDrrFromLEA (unsigned LEAOpcode)
 
static unsigned getSUBrrFromLEA (unsigned LEAOpcode)
 
static unsigned getADDriFromLEA (unsigned LEAOpcode, const MachineOperand &Offset)
 
static unsigned getINCDECFromLEA (unsigned LEAOpcode, bool IsINC)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   FIXUPLEA_NAME

Definition at line 33 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_DESC

#define FIXUPLEA_DESC   "X86 LEA Fixup"

Definition at line 30 of file X86FixupLEAs.cpp.

◆ FIXUPLEA_NAME

#define FIXUPLEA_NAME   "x86-fixup-LEAs"

Definition at line 31 of file X86FixupLEAs.cpp.

Function Documentation

◆ getADDriFromLEA()

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

Definition at line 376 of file X86FixupLEAs.cpp.

References llvm::isInt< 8 >(), llvm_unreachable, and Offset.

◆ getADDrrFromLEA()

static unsigned getADDrrFromLEA ( unsigned  LEAOpcode)
inlinestatic

Definition at line 352 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ getINCDECFromLEA()

static unsigned getINCDECFromLEA ( unsigned  LEAOpcode,
bool  IsINC 
)
inlinestatic

Definition at line 390 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ getPreviousInstr()

static 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 296 of file X86FixupLEAs.cpp.

References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), I, llvm::MachineBasicBlock::isPredecessor(), and MBB.

◆ getSUBrrFromLEA()

static unsigned getSUBrrFromLEA ( unsigned  LEAOpcode)
inlinestatic

Definition at line 364 of file X86FixupLEAs.cpp.

References llvm_unreachable.

◆ hasInefficientLEABaseReg()

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

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

Definition at line 342 of file X86FixupLEAs.cpp.

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

◆ hasLEAOffset()

static bool hasLEAOffset ( const MachineOperand Offset)
inlinestatic

Definition at line 348 of file X86FixupLEAs.cpp.

References Offset.

◆ isInefficientLEAReg()

static bool isInefficientLEAReg ( unsigned  Reg)
inlinestatic

Definition at line 333 of file X86FixupLEAs.cpp.

References Reg.

Referenced by hasInefficientLEABaseReg().

◆ isLEA()

static bool isLEA ( unsigned  Opcode)
static

Definition at line 220 of file X86FixupLEAs.cpp.

◆ STATISTIC()

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