LLVM API Documentation

ARMLoadStoreOptimizer.cpp File Reference

#include "ARM.h"
#include "ARMAddressingModes.h"
#include "ARMBaseInstrInfo.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMRegisterInfo.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"

Include dependency graph for ARMLoadStoreOptimizer.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "arm-ldst-opt"

Functions

 STATISTIC (NumLDMGened,"Number of ldm instructions generated")
 STATISTIC (NumSTMGened,"Number of stm instructions generated")
 STATISTIC (NumFLDMGened,"Number of fldm instructions generated")
 STATISTIC (NumFSTMGened,"Number of fstm instructions generated")
 STATISTIC (NumLdStMoved,"Number of load / store instructions moved")
 STATISTIC (NumLDRDFormed,"Number of ldrd created before allocation")
 STATISTIC (NumSTRDFormed,"Number of strd created before allocation")
 STATISTIC (NumLDRD2LDM,"Number of ldrd instructions turned back into ldm")
 STATISTIC (NumSTRD2STM,"Number of strd instructions turned back into stm")
 STATISTIC (NumLDRD2LDR,"Number of ldrd instructions turned back into ldr's")
 STATISTIC (NumSTRD2STR,"Number of strd instructions turned back into str's")
static int getLoadStoreMultipleOpcode (int Opcode)
static bool isT2i32Load (unsigned Opc)
static bool isi32Load (unsigned Opc)
static bool isT2i32Store (unsigned Opc)
static bool isi32Store (unsigned Opc)
static bool isMatchingDecrement (MachineInstr *MI, unsigned Base, unsigned Bytes, unsigned Limit, ARMCC::CondCodes Pred, unsigned PredReg)
static bool isMatchingIncrement (MachineInstr *MI, unsigned Base, unsigned Bytes, unsigned Limit, ARMCC::CondCodes Pred, unsigned PredReg)
static unsigned getLSMultipleTransferSize (MachineInstr *MI)
static unsigned getPreIndexedLoadStoreOpcode (unsigned Opc)
static unsigned getPostIndexedLoadStoreOpcode (unsigned Opc)
static bool isMemoryOp (const MachineInstr *MI)
static int getMemoryOpOffset (const MachineInstr *MI)
static void InsertLDR_STR (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, int OffImm, bool isDef, DebugLoc dl, unsigned NewOpc, unsigned Reg, bool RegDeadKill, unsigned BaseReg, bool BaseKill, unsigned OffReg, bool OffKill, ARMCC::CondCodes Pred, unsigned PredReg, const TargetInstrInfo *TII)
static bool IsSafeAndProfitableToMove (bool isLd, unsigned Base, MachineBasicBlock::iterator I, MachineBasicBlock::iterator E, SmallPtrSet< MachineInstr *, 4 > &MemOps, SmallSet< unsigned, 4 > &MemRegs, const TargetRegisterInfo *TRI)
FunctionPass * llvm::createARMLoadStoreOptimizationPass (bool PreAlloc=false)


Define Documentation

#define DEBUG_TYPE   "arm-ldst-opt"

Definition at line 15 of file ARMLoadStoreOptimizer.cpp.


Function Documentation

static int getLoadStoreMultipleOpcode ( int  Opcode  )  [static]

Definition at line 115 of file ARMLoadStoreOptimizer.cpp.

References llvm_unreachable.

static unsigned getLSMultipleTransferSize ( MachineInstr *  MI  )  [inline, static]

static int getMemoryOpOffset ( const MachineInstr *  MI  )  [static]

static unsigned getPostIndexedLoadStoreOpcode ( unsigned  Opc  )  [static]

Definition at line 523 of file ARMLoadStoreOptimizer.cpp.

References llvm_unreachable.

static unsigned getPreIndexedLoadStoreOpcode ( unsigned  Opc  )  [static]

Definition at line 504 of file ARMLoadStoreOptimizer.cpp.

References llvm_unreachable.

static void InsertLDR_STR ( MachineBasicBlock &  MBB,
MachineBasicBlock::iterator &  MBBI,
int  OffImm,
bool  isDef,
DebugLoc  dl,
unsigned  NewOpc,
unsigned  Reg,
bool  RegDeadKill,
unsigned  BaseReg,
bool  BaseKill,
unsigned  OffReg,
bool  OffKill,
ARMCC::CondCodes  Pred,
unsigned  PredReg,
const TargetInstrInfo *  TII 
) [static]

static bool isi32Load ( unsigned  Opc  )  [static]

Definition at line 152 of file ARMLoadStoreOptimizer.cpp.

References isT2i32Load().

static bool isi32Store ( unsigned  Opc  )  [static]

Definition at line 160 of file ARMLoadStoreOptimizer.cpp.

References isT2i32Store().

static bool isMatchingDecrement ( MachineInstr *  MI,
unsigned  Base,
unsigned  Bytes,
unsigned  Limit,
ARMCC::CondCodes  Pred,
unsigned  PredReg 
) [inline, static]

static bool isMatchingIncrement ( MachineInstr *  MI,
unsigned  Base,
unsigned  Bytes,
unsigned  Limit,
ARMCC::CondCodes  Pred,
unsigned  PredReg 
) [inline, static]

static bool isMemoryOp ( const MachineInstr *  MI  )  [static]

isMemoryOp - Returns true if instruction is a memory operations (that this pass is capable of operating on).

Definition at line 669 of file ARMLoadStoreOptimizer.cpp.

References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::MachineOperand::isReg().

static bool IsSafeAndProfitableToMove ( bool  isLd,
unsigned  Base,
MachineBasicBlock::iterator  I,
MachineBasicBlock::iterator  E,
SmallPtrSet< MachineInstr *, 4 > &  MemOps,
SmallSet< unsigned, 4 > &  MemRegs,
const TargetRegisterInfo *  TRI 
) [static]

static bool isT2i32Load ( unsigned  Opc  )  [static]

Definition at line 148 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Load().

static bool isT2i32Store ( unsigned  Opc  )  [static]

Definition at line 156 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Store().

STATISTIC ( NumSTRD2STR  ,
"Number of strd instructions turned back into str's"   
)

STATISTIC ( NumLDRD2LDR  ,
"Number of ldrd instructions turned back into ldr's"   
)

STATISTIC ( NumSTRD2STM  ,
"Number of strd instructions turned back into stm"   
)

STATISTIC ( NumLDRD2LDM  ,
"Number of ldrd instructions turned back into ldm"   
)

STATISTIC ( NumSTRDFormed  ,
"Number of strd created before allocation"   
)

STATISTIC ( NumLDRDFormed  ,
"Number of ldrd created before allocation"   
)

STATISTIC ( NumLdStMoved  ,
"Number of load / store instructions moved"   
)

STATISTIC ( NumFSTMGened  ,
"Number of fstm instructions generated"   
)

STATISTIC ( NumFLDMGened  ,
"Number of fldm instructions generated"   
)

STATISTIC ( NumSTMGened  ,
"Number of stm instructions generated"   
)

STATISTIC ( NumLDMGened  ,
"Number of ldm instructions generated"   
)


Variable Documentation

Definition at line 65 of file ARMLoadStoreOptimizer.cpp.

char ID [static]

Definition at line 60 of file ARMLoadStoreOptimizer.cpp.

Definition at line 67 of file ARMLoadStoreOptimizer.cpp.

MachineBasicBlock::iterator MBBI

Definition at line 80 of file ARMLoadStoreOptimizer.cpp.

Definition at line 1073 of file ARMLoadStoreOptimizer.cpp.

int Offset

Definition at line 77 of file ARMLoadStoreOptimizer.cpp.

Definition at line 66 of file ARMLoadStoreOptimizer.cpp.

const ARMSubtarget* STI

Definition at line 1072 of file ARMLoadStoreOptimizer.cpp.

const TargetData* TD

Definition at line 1069 of file ARMLoadStoreOptimizer.cpp.

Definition at line 63 of file ARMLoadStoreOptimizer.cpp.

Definition at line 64 of file ARMLoadStoreOptimizer.cpp.