LLVM  10.0.0svn
Macros | Enumerations | Functions | Variables
SILoadStoreOptimizer.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIInstrInfo.h"
#include "SIRegisterInfo.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.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/IR/DebugLoc.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <iterator>
#include <utility>
Include dependency graph for SILoadStoreOptimizer.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-load-store-opt"
 

Enumerations

enum  InstClassEnum
 
enum  RegisterEnum
 

Functions

 INITIALIZE_PASS_BEGIN (SILoadStoreOptimizer, DEBUG_TYPE, "SI Load Store Optimizer", false, false) INITIALIZE_PASS_END(SILoadStoreOptimizer
 
static void moveInstsAfter (MachineBasicBlock::iterator I, ArrayRef< MachineInstr *> InstsToMove)
 
static void addDefsUsesToList (const MachineInstr &MI, DenseSet< unsigned > &RegDefs, DenseSet< unsigned > &PhysRegUses)
 
static bool memAccessesCanBeReordered (MachineBasicBlock::iterator A, MachineBasicBlock::iterator B, AliasAnalysis *AA)
 
static bool addToListsIfDependent (MachineInstr &MI, DenseSet< unsigned > &RegDefs, DenseSet< unsigned > &PhysRegUses, SmallVectorImpl< MachineInstr *> &Insts)
 
static bool canMoveInstsAcrossMemOp (MachineInstr &MemOp, ArrayRef< MachineInstr *> InstsToMove, AliasAnalysis *AA)
 
static MachineMemOperandcombineKnownAdjacentMMOs (MachineFunction &MF, const MachineMemOperand *A, const MachineMemOperand *B)
 

Variables

 DEBUG_TYPE
 
SI Load Store Optimizer
 
SI Load Store false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-load-store-opt"

Definition at line 93 of file SILoadStoreOptimizer.cpp.

Enumeration Type Documentation

◆ InstClassEnum

Definition at line 96 of file SILoadStoreOptimizer.cpp.

◆ RegisterEnum

Definition at line 111 of file SILoadStoreOptimizer.cpp.

Function Documentation

◆ addDefsUsesToList()

static void addDefsUsesToList ( const MachineInstr MI,
DenseSet< unsigned > &  RegDefs,
DenseSet< unsigned > &  PhysRegUses 
)
static

◆ addToListsIfDependent()

static bool addToListsIfDependent ( MachineInstr MI,
DenseSet< unsigned > &  RegDefs,
DenseSet< unsigned > &  PhysRegUses,
SmallVectorImpl< MachineInstr *> &  Insts 
)
static

◆ canMoveInstsAcrossMemOp()

static bool canMoveInstsAcrossMemOp ( MachineInstr MemOp,
ArrayRef< MachineInstr *>  InstsToMove,
AliasAnalysis AA 
)
static

◆ combineKnownAdjacentMMOs()

static MachineMemOperand* combineKnownAdjacentMMOs ( MachineFunction MF,
const MachineMemOperand A,
const MachineMemOperand B 
)
static

Definition at line 311 of file SILoadStoreOptimizer.cpp.

References llvm::abs(), add(), llvm::MachineInstrBuilder::add(), addDefsUsesToList(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), addToListsIfDependent(), assert(), llvm::TargetLoweringBase::AddrMode::BaseOffs, llvm::MachineBasicBlock::begin(), llvm::BuildMI(), canMoveInstsAcrossMemOp(), llvm::MachineInstrBuilder::cloneMergedMemRefs(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::MachineOperand::CreateImm(), llvm::MachineOperand::CreateReg(), llvm::dbgs(), llvm::RegState::Dead, llvm::tgtok::Def, llvm::RegState::Define, llvm::MachineInstr::dump(), E, llvm::MachineBasicBlock::end(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFunction(), llvm::AMDGPU::getGlobalSaddrOp(), llvm::MachineOperand::getImm(), llvm::GCNSubtarget::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineFunction::getMachineMemOperand(), llvm::AMDGPU::getMUBUFBaseOpcode(), llvm::AMDGPU::getMUBUFElements(), llvm::AMDGPU::getMUBUFHasSoffset(), llvm::AMDGPU::getMUBUFHasSrsrc(), llvm::AMDGPU::getMUBUFHasVAddr(), llvm::AMDGPU::getMUBUFOpcode(), llvm::AMDGPU::getNamedOperandIdx(), llvm::MachineInstr::getNumOperands(), llvm::MachineMemOperand::getOffset(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), getReg(), llvm::MachineFunction::getRegInfo(), llvm::MachineMemOperand::getSize(), llvm::AMDGPU::getSMRDEncodedOffset(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getSubtarget(), llvm::GCNSubtarget::getTargetLowering(), llvm::TargetLoweringBase::AddrMode::HasBaseReg, llvm::GCNSubtarget::hasDwordx3LoadStores(), llvm::MachineInstr::hasOrderedMemoryRef(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineOperand::isImm(), llvm::SITargetLowering::isLegalGlobalAddressingMode(), llvm::Register::isPhysicalRegister(), isReg(), llvm::MachineOperand::isReg(), llvm::isUInt< 8 >(), llvm::RegState::Kill, llvm::GCNSubtarget::ldsRequiresM0Init(), LLVM_DEBUG, llvm_unreachable, llvm::GCNSubtarget::loadStoreOptEnabled(), llvm::Match, llvm::MachineInstr::mayLoad(), llvm::MachineInstr::mayStore(), memAccessesCanBeReordered(), MI, Modified, moveInstsAfter(), MRI, llvm::None, P, llvm::SmallVectorTemplateBase< T >::push_back(), Reg, llvm::MachineMemOperand::setOffset(), Size, std::swap(), TII, TRI, and llvm::LPAC::UNKNOWN.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( SILoadStoreOptimizer  ,
DEBUG_TYPE  ,
"SI Load Store Optimizer ,
false  ,
false   
)

◆ memAccessesCanBeReordered()

static bool memAccessesCanBeReordered ( MachineBasicBlock::iterator  A,
MachineBasicBlock::iterator  B,
AliasAnalysis AA 
)
static

Definition at line 258 of file SILoadStoreOptimizer.cpp.

Referenced by canMoveInstsAcrossMemOp(), and combineKnownAdjacentMMOs().

◆ moveInstsAfter()

static void moveInstsAfter ( MachineBasicBlock::iterator  I,
ArrayRef< MachineInstr *>  InstsToMove 
)
static

Definition at line 235 of file SILoadStoreOptimizer.cpp.

References I, llvm::MachineBasicBlock::insert(), and MI.

Referenced by combineKnownAdjacentMMOs().

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 224 of file SILoadStoreOptimizer.cpp.

◆ false

SI Load Store false

Definition at line 224 of file SILoadStoreOptimizer.cpp.

◆ Optimizer

SI Load Store Optimizer

Definition at line 224 of file SILoadStoreOptimizer.cpp.