LLVM  3.7.0
Macros | Functions | Variables
AArch64LoadStoreOptimizer.cpp File Reference
#include "AArch64InstrInfo.h"
#include "AArch64Subtarget.h"
#include "MCTargetDesc/AArch64AddressingModes.h"
#include "llvm/ADT/BitVector.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/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
Include dependency graph for AArch64LoadStoreOptimizer.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "aarch64-ldst-opt"
 

Functions

 STATISTIC (NumPairCreated,"Number of load/store pair instructions generated")
 AArch64AllocLoadStoreOpt - Post-register allocation pass to combine load / store instructions to form ldp / stp instructions. More...
 
 STATISTIC (NumPostFolded,"Number of post-index updates folded")
 
 STATISTIC (NumPreFolded,"Number of pre-index updates folded")
 
 STATISTIC (NumUnscaledPairCreated,"Number of load/store from unscaled generated")
 
static bool isUnscaledLdst (unsigned Opc)
 
static unsigned getMatchingNonSExtOpcode (unsigned Opc, bool *IsValidLdStrOpc=nullptr)
 
static unsigned getMatchingPairOpcode (unsigned Opc)
 
static unsigned getPreIndexedOpcode (unsigned Opc)
 
static unsigned getPostIndexedOpcode (unsigned Opc)
 
static void trackRegDefsUses (MachineInstr *MI, BitVector &ModifiedRegs, BitVector &UsedRegs, const TargetRegisterInfo *TRI)
 trackRegDefsUses - Remember what registers the specified instruction uses and modifies. More...
 
static bool inBoundsForPair (bool IsUnscaled, int Offset, int OffsetStride)
 
static int alignTo (int Num, int PowOf2)
 
static bool mayAlias (MachineInstr *MIa, MachineInstr *MIb, const AArch64InstrInfo *TII)
 
static bool mayAlias (MachineInstr *MIa, SmallVectorImpl< MachineInstr * > &MemInsns, const AArch64InstrInfo *TII)
 
static bool isMatchingUpdateInsn (MachineInstr *MI, unsigned BaseReg, int Offset)
 

Variables

static cl::opt< unsignedScanLimit ("aarch64-load-store-scan-limit", cl::init(20), cl::Hidden)
 
static cl::opt< boolEnableAArch64UnscaledMemOp ("aarch64-unscaled-mem-op", cl::Hidden, cl::desc("Allow AArch64 unscaled load/store combining"), cl::init(true))
 

Macro Definition Documentation

#define DEBUG_TYPE   "aarch64-ldst-opt"

Definition at line 34 of file AArch64LoadStoreOptimizer.cpp.

Function Documentation

static int alignTo ( int  Num,
int  PowOf2 
)
static

Definition at line 483 of file AArch64LoadStoreOptimizer.cpp.

static unsigned getMatchingNonSExtOpcode ( unsigned  Opc,
bool IsValidLdStrOpc = nullptr 
)
static

Definition at line 193 of file AArch64LoadStoreOptimizer.cpp.

static unsigned getMatchingPairOpcode ( unsigned  Opc)
static

Definition at line 230 of file AArch64LoadStoreOptimizer.cpp.

References llvm_unreachable.

static unsigned getPostIndexedOpcode ( unsigned  Opc)
static

Definition at line 299 of file AArch64LoadStoreOptimizer.cpp.

References llvm_unreachable.

static unsigned getPreIndexedOpcode ( unsigned  Opc)
static

Definition at line 270 of file AArch64LoadStoreOptimizer.cpp.

References llvm_unreachable.

static bool inBoundsForPair ( bool  IsUnscaled,
int  Offset,
int  OffsetStride 
)
static

Definition at line 466 of file AArch64LoadStoreOptimizer.cpp.

static bool isMatchingUpdateInsn ( MachineInstr MI,
unsigned  BaseReg,
int  Offset 
)
static
static bool isUnscaledLdst ( unsigned  Opc)
static

Definition at line 123 of file AArch64LoadStoreOptimizer.cpp.

static bool mayAlias ( MachineInstr MIa,
MachineInstr MIb,
const AArch64InstrInfo TII 
)
static
static bool mayAlias ( MachineInstr MIa,
SmallVectorImpl< MachineInstr * > &  MemInsns,
const AArch64InstrInfo TII 
)
static

Definition at line 500 of file AArch64LoadStoreOptimizer.cpp.

References mayAlias().

STATISTIC ( NumPairCreated  ,
"Number of load/store pair instructions generated"   
)

AArch64AllocLoadStoreOpt - Post-register allocation pass to combine load / store instructions to form ldp / stp instructions.

STATISTIC ( NumPostFolded  ,
"Number of post-index updates folded"   
)
STATISTIC ( NumPreFolded  ,
"Number of pre-index updates folded"   
)
STATISTIC ( NumUnscaledPairCreated  ,
"Number of load/store from unscaled generated"   
)
static void trackRegDefsUses ( MachineInstr MI,
BitVector ModifiedRegs,
BitVector UsedRegs,
const TargetRegisterInfo TRI 
)
static

Variable Documentation

cl::opt<bool> EnableAArch64UnscaledMemOp("aarch64-unscaled-mem-op", cl::Hidden, cl::desc("Allow AArch64 unscaled load/store combining"), cl::init(true))
static
cl::opt<unsigned> ScanLimit("aarch64-load-store-scan-limit", cl::init(20), cl::Hidden)
static