|
LLVM
4.0.0
|
#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"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "aarch64-ldst-opt" |
| #define | AARCH64_LOAD_STORE_OPT_NAME "AArch64 load / store optimization pass" |
Functions | |
| STATISTIC (NumPairCreated,"Number of load/store pair instructions generated") | |
| 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") | |
| STATISTIC (NumZeroStoresPromoted,"Number of narrow zero stores promoted") | |
| STATISTIC (NumLoadsFromStoresPromoted,"Number of loads from stores promoted") | |
| INITIALIZE_PASS (AArch64LoadStoreOpt,"aarch64-ldst-opt", AARCH64_LOAD_STORE_OPT_NAME, false, false) static bool isNarrowStore(unsigned Opc) | |
| static int | getMemScale (MachineInstr &MI) |
| static unsigned | getMatchingNonSExtOpcode (unsigned Opc, bool *IsValidLdStrOpc=nullptr) |
| static unsigned | getMatchingWideOpcode (unsigned Opc) |
| static unsigned | getMatchingPairOpcode (unsigned Opc) |
| static unsigned | isMatchingStore (MachineInstr &LoadInst, MachineInstr &StoreInst) |
| static unsigned | getPreIndexedOpcode (unsigned Opc) |
| static unsigned | getPostIndexedOpcode (unsigned Opc) |
| static bool | isPairedLdSt (const MachineInstr &MI) |
| static const MachineOperand & | getLdStRegOp (const MachineInstr &MI, unsigned PairedRegOp=0) |
| static const MachineOperand & | getLdStBaseOp (const MachineInstr &MI) |
| static const MachineOperand & | getLdStOffsetOp (const MachineInstr &MI) |
| static bool | isLdOffsetInRangeOfSt (MachineInstr &LoadInst, MachineInstr &StoreInst, const AArch64InstrInfo *TII) |
| static bool | isPromotableZeroStoreInst (MachineInstr &MI) |
| static void | trackRegDefsUses (const 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 | areCandidatesToMergeOrPair (MachineInstr &FirstMI, MachineInstr &MI, LdStPairFlags &Flags, const AArch64InstrInfo *TII) |
Variables | |
| static cl::opt< unsigned > | LdStLimit ("aarch64-load-store-scan-limit", cl::init(20), cl::Hidden) |
| static cl::opt< unsigned > | UpdateLimit ("aarch64-update-scan-limit", cl::init(100), cl::Hidden) |
| #define AARCH64_LOAD_STORE_OPT_NAME "AArch64 load / store optimization pass" |
Definition at line 53 of file AArch64LoadStoreOptimizer.cpp.
| #define DEBUG_TYPE "aarch64-ldst-opt" |
Definition at line 34 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 921 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 1008 of file AArch64LoadStoreOptimizer.cpp.
References assert(), getMatchingNonSExtOpcode(), getMatchingPairOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::AArch64InstrInfo::isLdStPairSuppressed(), and llvm::AArch64InstrInfo::isUnscaledLdSt().
|
static |
Definition at line 515 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOperand(), and isPairedLdSt().
|
static |
Definition at line 520 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOperand(), and isPairedLdSt().
Referenced by isLdOffsetInRangeOfSt().
|
static |
Definition at line 508 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineInstr::getOperand(), and isPairedLdSt().
Referenced by isPromotableZeroStoreInst().
Definition at line 241 of file AArch64LoadStoreOptimizer.cpp.
Referenced by areCandidatesToMergeOrPair().
Definition at line 301 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Referenced by areCandidatesToMergeOrPair().
Definition at line 282 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
|
static |
Definition at line 184 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode(), and llvm_unreachable.
Referenced by isLdOffsetInRangeOfSt().
Definition at line 430 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Definition at line 371 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Definition at line 904 of file AArch64LoadStoreOptimizer.cpp.
| INITIALIZE_PASS | ( | AArch64LoadStoreOpt | , |
| "aarch64-ldst-opt" | , | ||
| AARCH64_LOAD_STORE_OPT_NAME | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 168 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 525 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineOperand::getImm(), getLdStOffsetOp(), getMemScale(), isMatchingStore(), and llvm::AArch64InstrInfo::isUnscaledLdSt().
|
static |
Definition at line 341 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode(), and llvm_unreachable.
Referenced by isLdOffsetInRangeOfSt().
|
static |
Definition at line 489 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode().
Referenced by getLdStBaseOp(), getLdStOffsetOp(), and getLdStRegOp().
|
static |
Definition at line 541 of file AArch64LoadStoreOptimizer.cpp.
References getLdStRegOp(), llvm::MachineInstr::getOpcode(), and llvm::MachineOperand::getReg().
|
static |
Definition at line 925 of file AArch64LoadStoreOptimizer.cpp.
References llvm::AArch64InstrInfo::areMemAccessesTriviallyDisjoint(), llvm::MachineInstr::mayLoadOrStore(), and llvm::MachineInstr::mayStore().
Referenced by mayAlias().
|
static |
Definition at line 938 of file AArch64LoadStoreOptimizer.cpp.
References mayAlias().
| STATISTIC | ( | NumPairCreated | , |
| "Number of load/store pair instructions generated" | |||
| ) |
| 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" | |||
| ) |
| STATISTIC | ( | NumZeroStoresPromoted | , |
| "Number of narrow zero stores promoted" | |||
| ) |
| STATISTIC | ( | NumLoadsFromStoresPromoted | , |
| "Number of loads from stores promoted" | |||
| ) |
|
static |
trackRegDefsUses - Remember what registers the specified instruction uses and modifies.
Definition at line 879 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MCRegAliasIterator::isValid(), llvm::MachineInstr::operands(), llvm::BitVector::set(), and llvm::BitVector::setBitsNotInMask().
1.8.6