LLVM API Documentation

Namespaces | Defines | Functions
ARMLoadStoreOptimizer.cpp File Reference
#include "ARM.h"
#include "ARMBaseInstrInfo.h"
#include "ARMBaseRegisterInfo.h"
#include "ARMISelLowering.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMAddressingModes.h"
#include "Thumb1RegisterInfo.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 "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/CodeGen/SelectionDAGNodes.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
Include dependency graph for ARMLoadStoreOptimizer.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm
 

List of target independent CodeGen pass IDs.


namespace  llvm::ARM_AM
 

ARM_AM - ARM Addressing Mode Stuff.


Defines

#define DEBUG_TYPE   "arm-ldst-opt"

Functions

 STATISTIC (NumLDMGened,"Number of ldm instructions generated")
 STATISTIC (NumSTMGened,"Number of stm instructions generated")
 STATISTIC (NumVLDMGened,"Number of vldm instructions generated")
 STATISTIC (NumVSTMGened,"Number of vstm 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, ARM_AM::AMSubMode Mode)
AMSubMode llvm::ARM_AM::getLoadStoreMultipleSubMode (int Opcode)
static bool isT1i32Load (unsigned Opc)
static bool isT2i32Load (unsigned Opc)
static bool isi32Load (unsigned Opc)
static bool isT1i32Store (unsigned Opc)
static bool isT2i32Store (unsigned Opc)
static bool isi32Store (unsigned Opc)
static bool definesCPSR (MachineInstr *MI)
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 getUpdatingLSMultipleOpcode (unsigned Opc, ARM_AM::AMSubMode Mode)
static unsigned getPreIndexedLoadStoreOpcode (unsigned Opc, ARM_AM::AddrOpc Mode)
static unsigned getPostIndexedLoadStoreOpcode (unsigned Opc, ARM_AM::AddrOpc Mode)
static bool isMemoryOp (const MachineInstr *MI)
static int getMemoryOpOffset (const MachineInstr *MI)
static void InsertLDR_STR (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, int Offset, bool isDef, DebugLoc dl, unsigned NewOpc, unsigned Reg, bool RegDeadKill, bool RegUndef, unsigned BaseReg, bool BaseKill, bool BaseUndef, bool OffKill, bool OffUndef, ARMCC::CondCodes Pred, unsigned PredReg, const TargetInstrInfo *TII, bool isT2)
static bool IsSafeAndProfitableToMove (bool isLd, unsigned Base, MachineBasicBlock::iterator I, MachineBasicBlock::iterator E, SmallPtrSetImpl< MachineInstr * > &MemOps, SmallSet< unsigned, 4 > &MemRegs, const TargetRegisterInfo *TRI)
static void concatenateMemOperands (MachineInstr *MI, MachineInstr *Op0, MachineInstr *Op1)
 Copy Op0 and Op1 operands into a new array assigned to MI.

Define Documentation

#define DEBUG_TYPE   "arm-ldst-opt"

Definition at line 46 of file ARMLoadStoreOptimizer.cpp.


Function Documentation

static void concatenateMemOperands ( MachineInstr MI,
MachineInstr Op0,
MachineInstr Op1 
) [static]
static bool definesCPSR ( MachineInstr MI) [static]
static int getLoadStoreMultipleOpcode ( int  Opcode,
ARM_AM::AMSubMode  Mode 
) [static]
static unsigned getLSMultipleTransferSize ( MachineInstr MI) [inline, static]
static int getMemoryOpOffset ( const MachineInstr MI) [static]
static unsigned getPostIndexedLoadStoreOpcode ( unsigned  Opc,
ARM_AM::AddrOpc  Mode 
) [static]

Definition at line 1022 of file ARMLoadStoreOptimizer.cpp.

References llvm::ARM_AM::add, and llvm_unreachable.

static unsigned getPreIndexedLoadStoreOpcode ( unsigned  Opc,
ARM_AM::AddrOpc  Mode 
) [static]

Definition at line 997 of file ARMLoadStoreOptimizer.cpp.

References llvm::ARM_AM::add, and llvm_unreachable.

static unsigned getUpdatingLSMultipleOpcode ( unsigned  Opc,
ARM_AM::AMSubMode  Mode 
) [static]
static void InsertLDR_STR ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
int  Offset,
bool  isDef,
DebugLoc  dl,
unsigned  NewOpc,
unsigned  Reg,
bool  RegDeadKill,
bool  RegUndef,
unsigned  BaseReg,
bool  BaseKill,
bool  BaseUndef,
bool  OffKill,
bool  OffUndef,
ARMCC::CondCodes  Pred,
unsigned  PredReg,
const TargetInstrInfo TII,
bool  isT2 
) [static]
static bool isi32Load ( unsigned  Opc) [static]

Definition at line 294 of file ARMLoadStoreOptimizer.cpp.

References isT1i32Load(), and isT2i32Load().

static bool isi32Store ( unsigned  Opc) [static]

Definition at line 306 of file ARMLoadStoreOptimizer.cpp.

References isT1i32Store(), and isT2i32Store().

static bool isMatchingDecrement ( MachineInstr MI,
unsigned  Base,
unsigned  Bytes,
unsigned  Limit,
ARMCC::CondCodes  Pred,
unsigned  PredReg 
) [static]
static bool isMatchingIncrement ( MachineInstr MI,
unsigned  Base,
unsigned  Bytes,
unsigned  Limit,
ARMCC::CondCodes  Pred,
unsigned  PredReg 
) [static]
static bool isMemoryOp ( const MachineInstr MI) [static]
static bool isT1i32Load ( unsigned  Opc) [static]

Definition at line 286 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Load().

static bool isT1i32Store ( unsigned  Opc) [static]

Definition at line 298 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Store().

static bool isT2i32Load ( unsigned  Opc) [static]

Definition at line 290 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Load().

static bool isT2i32Store ( unsigned  Opc) [static]

Definition at line 302 of file ARMLoadStoreOptimizer.cpp.

Referenced by isi32Store().

STATISTIC ( NumLDMGened  ,
"Number of ldm instructions generated  
)
STATISTIC ( NumSTMGened  ,
"Number of stm instructions generated  
)
STATISTIC ( NumVLDMGened  ,
"Number of vldm instructions generated  
)
STATISTIC ( NumVSTMGened  ,
"Number of vstm 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"   
)