LLVM
8.0.1
|
#include "MCTargetDesc/X86BaseInfo.h"
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <iterator>
Go to the source code of this file.
Classes | |
struct | llvm::DenseMapInfo< MemOpKey > |
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
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. More... | |
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. More... | |
static bool | isLEA (const MachineInstr &MI) |
Returns true if the instruction is LEA. More... | |
static MemOpKey | getMemOpKey (const MachineInstr &MI, unsigned N) |
Returns a hash table key based on memory operands of MI . More... | |
static bool | isValidDispOp (const MachineOperand &MO) |
Variables | |
static cl::opt< bool > | DisableX86LEAOpt ("disable-x86-lea-opt", cl::Hidden, cl::desc("X86: Disable LEA optimizations."), cl::init(false)) |
#define DEBUG_TYPE "x86-optimize-LEAs" |
Definition at line 53 of file X86OptimizeLEAs.cpp.
|
inlinestatic |
Returns a hash table key based on memory operands of MI
.
The number of the first memory operand of MI
is specified through N
.
Definition at line 189 of file X86OptimizeLEAs.cpp.
References llvm::X86::AddrBaseReg, llvm::X86::AddrDisp, llvm::X86::AddrIndexReg, llvm::X86::AddrScaleAmt, llvm::X86::AddrSegmentReg, assert(), llvm::MachineInstr::getOperand(), isLEA(), and llvm::MachineInstr::mayLoadOrStore().
Referenced by llvm::createX86OptimizeLEAs().
|
inlinestatic |
Returns true if two machine operands are identical and they are not physical registers.
Definition at line 199 of file X86OptimizeLEAs.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isIdenticalTo(), llvm::TargetRegisterInfo::isPhysicalRegister(), and llvm::MachineOperand::isReg().
Referenced by llvm::createX86OptimizeLEAs().
|
inlinestatic |
Returns true if the instruction is LEA.
Definition at line 231 of file X86OptimizeLEAs.cpp.
References llvm::MachineInstr::getOpcode(), List, MI, MRI, TII, and TRI.
Referenced by llvm::createX86OptimizeLEAs(), and getMemOpKey().
|
static |
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().
Referenced by llvm::createX86OptimizeLEAs().
|
static |
Definition at line 207 of file X86OptimizeLEAs.cpp.
References llvm::MachineOperand::isBlockAddress(), llvm::MachineOperand::isCPI(), llvm::MachineOperand::isGlobal(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isJTI(), llvm::MachineOperand::isMBB(), llvm::MachineOperand::isMCSymbol(), and llvm::MachineOperand::isSymbol().
Referenced by isSimilarDispOp().
STATISTIC | ( | NumSubstLEAs | , |
"Number of LEA instruction substitutions" | |||
) |
STATISTIC | ( | NumRedundantLEAs | , |
"Number of redundant LEA instructions removed" | |||
) |