|
LLVM 24.0.0git
|
#include "ARM.h"#include "ARMBaseInstrInfo.h"#include "ARMBaseRegisterInfo.h"#include "ARMISelLowering.h"#include "ARMMachineFunctionInfo.h"#include "ARMSubtarget.h"#include "MCTargetDesc/ARMAddressingModes.h"#include "MCTargetDesc/ARMBaseInfo.h"#include "Utils/ARMBaseInfo.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SetVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/iterator_range.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/CodeGen/LiveRegUnits.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineDominators.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/MachineMemOperand.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/RegisterClassInfo.h"#include "llvm/CodeGen/TargetFrameLowering.h"#include "llvm/CodeGen/TargetInstrInfo.h"#include "llvm/CodeGen/TargetLowering.h"#include "llvm/CodeGen/TargetRegisterInfo.h"#include "llvm/CodeGen/TargetSubtargetInfo.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DebugLoc.h"#include "llvm/IR/Function.h"#include "llvm/IR/Type.h"#include "llvm/InitializePasses.h"#include "llvm/MC/MCInstrDesc.h"#include "llvm/Pass.h"#include "llvm/Support/Allocator.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/raw_ostream.h"#include <cassert>#include <cstddef>#include <cstdlib>#include <iterator>#include <limits>#include <utility>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "arm-ldst-opt" |
| #define | ARM_LOAD_STORE_OPT_NAME "ARM load / store optimization pass" |
| #define | ARM_PREALLOC_LOAD_STORE_OPT_NAME "ARM pre- register allocation load / store optimization pass" |
Variables | |
| arm ldst | opt |
| arm ldst | ARM_LOAD_STORE_OPT_NAME |
| arm ldst | false |
| arm prera ldst | ARM_PREALLOC_LOAD_STORE_OPT_NAME |
| #define ARM_LOAD_STORE_OPT_NAME "ARM load / store optimization pass" |
Definition at line 85 of file ARMLoadStoreOptimizer.cpp.
Referenced by INITIALIZE_PASS_BEGIN().
| #define ARM_PREALLOC_LOAD_STORE_OPT_NAME "ARM pre- register allocation load / store optimization pass" |
Definition at line 2151 of file ARMLoadStoreOptimizer.cpp.
Referenced by INITIALIZE_PASS_BEGIN().
| #define DEBUG_TYPE "arm-ldst-opt" |
Definition at line 71 of file ARMLoadStoreOptimizer.cpp.
|
static |
Definition at line 3040 of file ARMLoadStoreOptimizer.cpp.
References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), assert(), llvm::BuildMI(), llvm::MachineInstrBuilder::cloneMemRefs(), getBaseOperandIndex(), llvm::MachineFunction::getRegInfo(), llvm::isLegalAddressImm(), llvm_unreachable, MI, MRI, llvm::Offset, TII, and TRI.
Definition at line 624 of file ARMLoadStoreOptimizer.cpp.
References Reg.
|
static |
Definition at line 2554 of file ARMLoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 3095 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::add, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ARMII::AddrModeMask, llvm::ARMII::AddrModeT2_i7, llvm::ARMII::AddrModeT2_i7s2, llvm::ARMII::AddrModeT2_i7s4, llvm::ARMII::AddrModeT2_i8, llvm::BuildMI(), llvm::MachineInstrBuilder::cloneMemRefs(), llvm::Define, getPostIndexedLoadStoreOpcode(), llvm::MachineFunction::getRegInfo(), llvm_unreachable, MI, MRI, llvm::Offset, llvm::ARM_AM::sub, TII, and TRI.
|
static |
Definition at line 211 of file ARMLoadStoreOptimizer.cpp.
References const, definesCPSR(), and MI.
Referenced by llvm::ARMTargetLowering::AdjustInstrPostInstrSelection(), definesCPSR(), and isIncrementOrDecrement().
|
static |
Searches for a increment or decrement of Reg after MBBI.
Definition at line 1251 of file ARMLoadStoreOptimizer.cpp.
References isIncrementOrDecrement(), MBB, MBBI, llvm::Off, llvm::Offset, Pred, Reg, and TRI.
|
static |
Searches for an increment or decrement of Reg before MBBI.
Definition at line 1231 of file ARMLoadStoreOptimizer.cpp.
References isIncrementOrDecrement(), MBB, MBBI, llvm::Offset, Pred, and Reg.
|
static |
Definition at line 2524 of file ARMLoadStoreOptimizer.cpp.
Referenced by updateRegisterMapForDbgValueListAfterMove().
|
static |
Definition at line 2906 of file ARMLoadStoreOptimizer.cpp.
References MI.
Referenced by AdjustBaseAndOffset().
Definition at line 427 of file ARMLoadStoreOptimizer.cpp.
References llvm_unreachable, and Opc.
|
static |
Definition at line 252 of file ARMLoadStoreOptimizer.cpp.
References MI.
Referenced by mayCombineMisaligned().
|
static |
Definition at line 260 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::da, llvm::ARM_AM::db, llvm::ARM_AM::ia, llvm::ARM_AM::ib, llvm_unreachable, and Mode.
|
static |
Definition at line 345 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::da, llvm::ARM_AM::db, llvm::ARM_AM::ia, llvm::ARM_AM::ib, and llvm_unreachable.
|
static |
Definition at line 256 of file ARMLoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 444 of file ARMLoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 224 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::getAM3Offset(), llvm::ARM_AM::getAM3Op(), llvm::ARM_AM::getAM5Offset(), llvm::ARM_AM::getAM5Op(), MI, llvm::Offset, and llvm::ARM_AM::sub.
|
static |
Definition at line 1400 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::add, llvm_unreachable, Mode, and Opc.
Referenced by createPostIncLoadStore().
|
static |
Definition at line 1375 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::add, llvm_unreachable, Mode, and Opc.
|
static |
Definition at line 1129 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARM_AM::da, llvm::ARM_AM::db, llvm::ARM_AM::ia, llvm::ARM_AM::ib, llvm_unreachable, Mode, and Opc.
| INITIALIZE_PASS_BEGIN | ( | ARMLoadStoreOptLegacy | , |
| "arm-ldst-opt" | , | ||
| ARM_LOAD_STORE_OPT_NAME | , | ||
| false | , | ||
| false | ) |
References ARM_LOAD_STORE_OPT_NAME, and INITIALIZE_PASS_DEPENDENCY.
| INITIALIZE_PASS_BEGIN | ( | ARMPreAllocLoadStoreOptLegacy | , |
| "arm-prera-ldst-opt" | , | ||
| ARM_PREALLOC_LOAD_STORE_OPT_NAME | , | ||
| false | , | ||
| false | ) |
References ARM_PREALLOC_LOAD_STORE_OPT_NAME, INITIALIZE_PASS_DEPENDENCY, and INITIALIZE_PASS_END.
|
static |
Definition at line 1741 of file ARMLoadStoreOptimizer.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineInstrBuilder::cloneMemRefs(), llvm::getDeadRegState(), llvm::getDefRegState(), llvm::getKillRegState(), llvm::getUndefRegState(), MBB, MBBI, MI, llvm::Offset, Pred, Reg, and TII.
Definition at line 407 of file ARMLoadStoreOptimizer.cpp.
References isT1i32Load(), isT2i32Load(), and Opc.
Referenced by isLoadSingle(), and mayCombineMisaligned().
Definition at line 419 of file ARMLoadStoreOptimizer.cpp.
References isT1i32Store(), isT2i32Store(), and Opc.
Referenced by mayCombineMisaligned().
|
static |
Check if the given instruction increments or decrements a register and return the amount it is incremented/decremented.
Returns 0 if the CPSR flags generated by the instruction are possibly read as well.
Definition at line 1199 of file ARMLoadStoreOptimizer.cpp.
References definesCPSR(), llvm::getInstrPredicate(), MI, Pred, and Reg.
Referenced by findIncDecAfter(), and findIncDecBefore().
|
static |
Definition at line 3020 of file ARMLoadStoreOptimizer.cpp.
References llvm::ARMII::AddrModeMask, llvm::ARMII::AddrModeT2_i12, Imm, llvm::isLegalAddressImm(), and TII.
Definition at line 423 of file ARMLoadStoreOptimizer.cpp.
References isi32Load(), and Opc.
|
static |
Returns true if instruction is a memory operation that this pass is capable of operating on.
Definition at line 1686 of file ARMLoadStoreOptimizer.cpp.
References llvm::MachineMemOperand::getAlign(), llvm::MachineMemOperand::isAtomic(), llvm::MachineMemOperand::isVolatile(), and MI.
|
static |
Definition at line 2971 of file ARMLoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 2993 of file ARMLoadStoreOptimizer.cpp.
References MI.
|
static |
Definition at line 2248 of file ARMLoadStoreOptimizer.cpp.
References AbstractManglingParser< Derived, Alloc >::NumOps, llvm::sampleprof::Base, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SmallSet< T, N, C >::count(), E(), llvm::MachineOperand::getReg(), I, llvm::SmallSet< T, N, C >::insert(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), Reg, llvm::SmallSet< T, N, C >::size(), and TRI.
Definition at line 399 of file ARMLoadStoreOptimizer.cpp.
References Opc.
Referenced by isi32Load().
Definition at line 411 of file ARMLoadStoreOptimizer.cpp.
References Opc.
Referenced by isi32Store().
Definition at line 403 of file ARMLoadStoreOptimizer.cpp.
References Opc.
Referenced by isi32Load().
Definition at line 415 of file ARMLoadStoreOptimizer.cpp.
References Opc.
Referenced by isi32Store().
|
static |
Definition at line 986 of file ARMLoadStoreOptimizer.cpp.
References llvm::abs(), and llvm::Offset.
|
static |
Return true for loads/stores that can be combined to a double/multi operation without increasing the requirements for alignment.
Definition at line 995 of file ARMLoadStoreOptimizer.cpp.
References llvm::TargetSubtargetInfo::getFrameLowering(), getLoadStoreBaseOp(), getReg(), llvm::TargetFrameLowering::getTransientStackAlign(), isi32Load(), isi32Store(), and MI.
| STATISTIC | ( | NumLDMGened | , |
| "Number of ldm instructions generated" | ) |
| STATISTIC | ( | NumLDRD2LDM | , |
| "Number of ldrd instructions turned back into ldm" | ) |
| STATISTIC | ( | NumLDRD2LDR | , |
| "Number of ldrd instructions turned back into ldr's" | ) |
| STATISTIC | ( | NumLDRDFormed | , |
| "Number of ldrd created before allocation" | ) |
| STATISTIC | ( | NumLdStMoved | , |
| "Number of load / store instructions moved" | ) |
| STATISTIC | ( | NumSTMGened | , |
| "Number of stm instructions generated" | ) |
| STATISTIC | ( | NumSTRD2STM | , |
| "Number of strd instructions turned back into stm" | ) |
| STATISTIC | ( | NumSTRD2STR | , |
| "Number of strd instructions turned back into str's" | ) |
| STATISTIC | ( | NumSTRDFormed | , |
| "Number of strd created before allocation" | ) |
| STATISTIC | ( | NumVLDMGened | , |
| "Number of vldm instructions generated" | ) |
| STATISTIC | ( | NumVSTMGened | , |
| "Number of vstm instructions generated" | ) |
|
static |
Definition at line 2541 of file ARMLoadStoreOptimizer.cpp.
References forEachDbgRegOperand(), and llvm::replace().
| arm ldst ARM_LOAD_STORE_OPT_NAME |
Definition at line 209 of file ARMLoadStoreOptimizer.cpp.
| arm prera ldst ARM_PREALLOC_LOAD_STORE_OPT_NAME |
Definition at line 2213 of file ARMLoadStoreOptimizer.cpp.
| arm prera ldst false |
Definition at line 209 of file ARMLoadStoreOptimizer.cpp.
| arm prera ldst opt |
Definition at line 208 of file ARMLoadStoreOptimizer.cpp.