|
LLVM 24.0.0git
|
#include "AArch64InstrInfo.h"#include "AArch64MachineFunctionInfo.h"#include "AArch64Subtarget.h"#include "MCTargetDesc/AArch64AddressingModes.h"#include "llvm/ADT/SetVector.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/MachineRegisterInfo.h"#include "llvm/CodeGen/TargetRegisterInfo.h"#include "llvm/IR/DebugLoc.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCDwarf.h"#include "llvm/Pass.h"#include "llvm/Support/Debug.h"#include "llvm/Support/DebugCounter.h"#include "llvm/Support/ErrorHandling.h"#include <cassert>#include <cstdint>#include <functional>#include <iterator>#include <limits>#include <optional>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" |
| #define AARCH64_LOAD_STORE_OPT_NAME "AArch64 load / store optimization pass" |
Definition at line 73 of file AArch64LoadStoreOptimizer.cpp.
Referenced by INITIALIZE_PASS().
| #define DEBUG_TYPE "aarch64-ldst-opt" |
Definition at line 54 of file AArch64LoadStoreOptimizer.cpp.
|
static |
This function will add a new entry into the debugValueSubstitutions table when two instruction have been merged into a new one represented by MergedInstr.
Definition at line 981 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineFunction::makeDebugValueSubstitution(), llvm::MachineInstr::operands(), llvm::MachineInstr::peekDebugInstrNum(), and Reg.
|
static |
Definition at line 1575 of file AArch64LoadStoreOptimizer.cpp.
Referenced by llvm::TargetFrameLowering::alignSPAdjust().
|
static |
Definition at line 1656 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineInstr::FrameDestroy, llvm::MachineInstr::FrameSetup, getLdStRegOp(), getMatchingNonSExtOpcode(), getMatchingPairOpcode(), llvm::MachineInstr::getOpcode(), llvm::MachineOperand::getReg(), llvm::MachineInstr::hasOrderedMemoryRef(), llvm::AArch64InstrInfo::isPreLdSt(), isPreLdStPairCandidate(), MI, and TII.
|
static |
Definition at line 1726 of file AArch64LoadStoreOptimizer.cpp.
References llvm::dbgs(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isEarlyClobber(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isRenamable(), isRewritableImplicitDef(), llvm::MachineOperand::isTied(), LLVM_DEBUG, MI, and TRI.
Referenced by canRenameUpToDef().
|
static |
Definition at line 1869 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::accumulate(), for(), llvm::ilist_node_impl< OptionsT >::getIterator(), getLdStRegOp(), llvm::MachineOperand::getReg(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineInstr::isPseudo(), MI, Success, and TRI.
Referenced by findRenameRegForSameLdStRegPair().
|
static |
Definition at line 1762 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::accumulate(), llvm::any_of(), canRenameMOP(), llvm::dbgs(), forAllMIsUntilDef(), llvm::MachineInstr::FrameSetup, getLdStRegOp(), llvm::MachineInstr::getMF(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getSubtarget(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineOperand::isDebug(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), LLVM_DEBUG, llvm::MachineInstr::mayStore(), MI, llvm::MachineInstr::operands(), and TRI.
Referenced by findRenameRegForSameLdStRegPair().
| DEBUG_COUNTER | ( | RegRenamingCounter | , |
| DEBUG_TYPE "-reg-renaming" | , | ||
| "Controls which pairs are considered for renaming" | ) |
References DEBUG_TYPE.
|
static |
Definition at line 1957 of file AArch64LoadStoreOptimizer.cpp.
References canRenameUntilSecondLoad(), canRenameUpToDef(), getLdStRegOp(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineInstr::mayLoad(), MI, Reg, llvm::DebugCounter::shouldExecute(), llvm::MachineRegisterInfo::tracksLiveness(), TRI, and tryToFindRegisterToRename().
|
static |
Definition at line 944 of file AArch64LoadStoreOptimizer.cpp.
References llvm::any_of(), I, llvm::instructionsWithoutDebug(), MBB, MI, and TRI.
Referenced by canRenameUpToDef().
Definition at line 515 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
Definition at line 3015 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 690 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::AArch64InstrInfo::isPairedLdSt(), llvm::AArch64InstrInfo::isPreLdSt(), and MI.
Referenced by areCandidatesToMergeOrPair(), canRenameUntilSecondLoad(), canRenameUpToDef(), findRenameRegForSameLdStRegPair(), and isPromotableZeroStoreInst().
Definition at line 266 of file AArch64LoadStoreOptimizer.cpp.
References Opc.
Referenced by areCandidatesToMergeOrPair().
Definition at line 340 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
Referenced by areCandidatesToMergeOrPair().
Definition at line 321 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
Definition at line 551 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
Definition at line 434 of file AArch64LoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
|
static |
Definition at line 672 of file AArch64LoadStoreOptimizer.cpp.
References llvm::AArch64InstrInfo::getMemScale(), llvm::AArch64InstrInfo::isPairedLdSt(), isTagStore(), and MI.
Definition at line 3059 of file AArch64LoadStoreOptimizer.cpp.
Definition at line 1558 of file AArch64LoadStoreOptimizer.cpp.
References llvm::Offset.
| INITIALIZE_PASS | ( | AArch64LoadStoreOptLegacy | , |
| "aarch64-ldst-opt" | , | ||
| AARCH64_LOAD_STORE_OPT_NAME | , | ||
| false | , | ||
| false | ) |
Definition at line 237 of file AArch64LoadStoreOptimizer.cpp.
References AARCH64_LOAD_STORE_OPT_NAME, and Opc.
|
static |
Definition at line 701 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::MachineOperand::getImm(), llvm::AArch64InstrInfo::getLdStOffsetOp(), isMatchingStore(), and TII.
|
static |
Definition at line 404 of file AArch64LoadStoreOptimizer.cpp.
References llvm::Instruction::getOpcode(), and llvm_unreachable.
Referenced by isLdOffsetInRangeOfSt().
|
static |
Definition at line 814 of file AArch64LoadStoreOptimizer.cpp.
|
static |
Definition at line 744 of file AArch64LoadStoreOptimizer.cpp.
References llvm::AArch64InstrInfo::getLdStBaseOp(), llvm::AArch64InstrInfo::getLdStOffsetOp(), llvm::AArch64FunctionInfo::isMTETagged(), MI, and Opc.
|
static |
Definition at line 638 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineInstr::getOpcode(), and MI.
Referenced by areCandidatesToMergeOrPair().
|
static |
Definition at line 726 of file AArch64LoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 719 of file AArch64LoadStoreOptimizer.cpp.
References getLdStRegOp(), llvm::MachineOperand::getReg(), MI, and Opc.
|
static |
Definition at line 848 of file AArch64LoadStoreOptimizer.cpp.
References llvm::MachineOperand::isRenamable(), and MI.
Referenced by canRenameMOP().
|
static |
Definition at line 254 of file AArch64LoadStoreOptimizer.cpp.
References MI.
Referenced by getPrePostIndexedMemOpInfo().
|
static |
Definition at line 1579 of file AArch64LoadStoreOptimizer.cpp.
References llvm::dbgs(), LLVM_DEBUG, and llvm::MachineInstr::mayAlias().
Referenced by llvm::HexagonInstrInfo::expandPostRAPseudo().
|
static |
Definition at line 2259 of file AArch64LoadStoreOptimizer.cpp.
References assert(), llvm::End, llvm::MachineInstr::FrameDestroy, llvm::MachineInstr::FrameSetup, llvm::MachineFunction::getFrameInstructions(), llvm::MCCFIInstruction::getOperation(), MI, llvm::MCCFIInstruction::OpDefCfa, and llvm::MCCFIInstruction::OpDefCfaOffset.
| STATISTIC | ( | NumConstOffsetFolded | , |
| "Number of const offset of index address folded" | ) |
| STATISTIC | ( | NumFailedAlignmentCheck | , |
| "Number of load/store pair transformation " "not passed the alignment check" | ) |
| 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" | ) |
|
static |
Definition at line 1913 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::addReg(), llvm::all_of(), llvm::any_of(), llvm::LiveRegUnits::available(), C(), llvm::dbgs(), llvm::MachineFunction::getRegInfo(), LLVM_DEBUG, llvm::printReg(), Reg, and TRI.
Referenced by findRenameRegForSameLdStRegPair().
|
static |
Definition at line 966 of file AArch64LoadStoreOptimizer.cpp.
References llvm::LiveRegUnits::addReg(), MI, llvm::phys_regs_and_masks(), llvm::LiveRegUnits::removeReg(), and TRI.