LLVM
8.0.1
|
#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/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/AliasAnalysis.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/TargetRegisterInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
#include <iterator>
#include <limits>
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" |
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 64 of file AArch64LoadStoreOptimizer.cpp.
#define DEBUG_TYPE "aarch64-ldst-opt" |
Definition at line 45 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 1015 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 1102 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::accumulateUsedDefed(), llvm::ARM_AM::add, llvm::alignTo(), assert(), B, llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::dbgs(), E, llvm::MachineBasicBlock::end(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), getLdStBaseOp(), getLdStOffsetOp(), getLdStRegOp(), getMatchingNonSExtOpcode(), getMatchingPairOpcode(), getMemScale(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), getPostIndexedOpcode(), getPreIndexedOpcode(), llvm::MachineOperand::getReg(), getReg(), llvm::AArch64_AM::getShiftValue(), llvm::MachineFunction::getSubtarget(), llvm::MachineInstr::hasOrderedMemoryRef(), I, inBoundsForPair(), llvm::MachineInstr::isCall(), llvm::MachineOperand::isImm(), llvm::AArch64InstrInfo::isLdStPairSuppressed(), isMergeableLdStUpdate(), isPairedLdSt(), isPromotableLoadFromStore(), isPromotableZeroStoreInst(), llvm::MachineInstr::isTransient(), llvm::AArch64InstrInfo::isUnscaledLdSt(), LdStLimit, LLVM_DEBUG, mayAlias(), llvm::MCID::MayLoad, llvm::MachineInstr::mayLoad(), llvm::MachineInstr::mayLoadOrStore(), MI, Modified, print(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, TII, TRI, and UpdateLimit.
|
static |
Definition at line 551 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOperand(), and isPairedLdSt().
Referenced by areCandidatesToMergeOrPair(), isMergeableLdStUpdate(), and mayAlias().
|
static |
Definition at line 556 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOperand(), and isPairedLdSt().
Referenced by areCandidatesToMergeOrPair(), isLdOffsetInRangeOfSt(), and isMergeableLdStUpdate().
|
static |
Definition at line 544 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineInstr::getOperand(), and isPairedLdSt().
Referenced by areCandidatesToMergeOrPair(), isMergeableLdStUpdate(), isPromotableZeroStoreInst(), and mayAlias().
Definition at line 263 of file AArch64LoadStoreOptimizer.cpp.
References llvm::max().
Referenced by areCandidatesToMergeOrPair(), and isMergeableLdStUpdate().
Definition at line 323 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Referenced by areCandidatesToMergeOrPair(), and isMergeableLdStUpdate().
Definition at line 304 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Referenced by isMergeableLdStUpdate().
|
static |
Definition at line 206 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode(), and llvm_unreachable.
Referenced by areCandidatesToMergeOrPair(), isLdOffsetInRangeOfSt(), and isMergeableLdStUpdate().
Definition at line 456 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Referenced by areCandidatesToMergeOrPair().
Definition at line 393 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable.
Referenced by areCandidatesToMergeOrPair().
Definition at line 998 of file AArch64LoadStoreOptimizer.cpp.
Referenced by areCandidatesToMergeOrPair().
INITIALIZE_PASS | ( | AArch64LoadStoreOpt | , |
"aarch64-ldst-opt" | , | ||
AARCH64_LOAD_STORE_OPT_NAME | , | ||
false | , | ||
false | |||
) |
Definition at line 190 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 561 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineOperand::getImm(), getLdStOffsetOp(), getMemScale(), isMatchingStore(), and llvm::AArch64InstrInfo::isUnscaledLdSt().
Referenced by mayAlias().
|
static |
Definition at line 363 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode(), and llvm_unreachable.
Referenced by isLdOffsetInRangeOfSt(), and mayAlias().
|
static |
Definition at line 602 of file AArch64LoadStoreOptimizer.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::dbgs(), llvm::RegState::Define, llvm::MachineOperand::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), getLdStBaseOp(), getLdStOffsetOp(), getLdStRegOp(), getMatchingNonSExtOpcode(), getMatchingPairOpcode(), getMatchingWideOpcode(), getMemScale(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::AArch64_AM::getShifterImm(), I, isPromotableZeroStoreInst(), llvm::MachineOperand::isUse(), llvm::AMDGPUISD::KILL, LLVM_DEBUG, llvm::AArch64_AM::LSL, llvm::make_range(), MI, print(), Reg, llvm::MachineOperand::setImplicit(), llvm::MachineOperand::setIsKill(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineOperand::setReg(), TII, and TRI.
Referenced by areCandidatesToMergeOrPair().
|
static |
Definition at line 525 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode().
Referenced by areCandidatesToMergeOrPair(), getLdStBaseOp(), getLdStOffsetOp(), and getLdStRegOp().
|
static |
Definition at line 584 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode().
Referenced by areCandidatesToMergeOrPair().
|
static |
Definition at line 577 of file AArch64LoadStoreOptimizer.cpp.
References getLdStRegOp(), llvm::MachineInstr::getOpcode(), and llvm::MachineOperand::getReg().
Referenced by areCandidatesToMergeOrPair(), and isMergeableLdStUpdate().
|
static |
Definition at line 1019 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::mayAlias(), llvm::MachineInstr::mayLoadOrStore(), and llvm::MachineInstr::mayStore().
Referenced by areCandidatesToMergeOrPair(), and mayAlias().
|
static |
Definition at line 1032 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::accumulateUsedDefed(), B, getLdStBaseOp(), getLdStRegOp(), llvm::MachineOperand::getReg(), getReg(), I, llvm::MachineInstr::isCall(), isLdOffsetInRangeOfSt(), isMatchingStore(), llvm::MachineInstr::isTransient(), mayAlias(), llvm::MachineInstr::mayStore(), MI, TII, and TRI.
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" | |||
) |
Referenced by areCandidatesToMergeOrPair().
Referenced by areCandidatesToMergeOrPair().