LLVM  10.0.0
Macros | Functions
SIPeepholeSDWA.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIDefines.h"
#include "SIInstrInfo.h"
#include "SIRegisterInfo.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.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/Config/llvm-config.h"
#include "llvm/MC/LaneBitmask.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <memory>
#include <unordered_map>
Include dependency graph for SIPeepholeSDWA.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-peephole-sdwa"
 

Functions

 STATISTIC (NumSDWAPatternsFound, "Number of SDWA patterns found.")
 
 STATISTIC (NumSDWAInstructionsPeepholed, "Number of instruction converted to SDWA.")
 
static raw_ostream & operator<< (raw_ostream &OS, SdwaSel Sel)
 
static raw_ostream & operator<< (raw_ostream &OS, const DstUnused &Un)
 
static void copyRegOperand (MachineOperand &To, const MachineOperand &From)
 
static bool isSameReg (const MachineOperand &LHS, const MachineOperand &RHS)
 
static MachineOperand * findSingleRegUse (const MachineOperand *Reg, const MachineRegisterInfo *MRI)
 
static MachineOperand * findSingleRegDef (const MachineOperand *Reg, const MachineRegisterInfo *MRI)
 
static raw_ostream & operator<< (raw_ostream &OS, const SDWAOperand &Operand)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-peephole-sdwa"

Definition at line 57 of file SIPeepholeSDWA.cpp.

Function Documentation

◆ copyRegOperand()

static void copyRegOperand ( MachineOperand &  To,
const MachineOperand &  From 
)
static

◆ findSingleRegDef()

static MachineOperand* findSingleRegDef ( const MachineOperand *  Reg,
const MachineRegisterInfo *  MRI 
)
static

◆ findSingleRegUse()

static MachineOperand* findSingleRegUse ( const MachineOperand *  Reg,
const MachineRegisterInfo *  MRI 
)
static

◆ isSameReg()

static bool isSameReg ( const MachineOperand &  LHS,
const MachineOperand &  RHS 
)
static

◆ operator<<() [1/3]

static raw_ostream& operator<< ( raw_ostream &  OS,
SdwaSel  Sel 
)
static

◆ operator<<() [2/3]

static raw_ostream& operator<< ( raw_ostream &  OS,
const DstUnused &  Un 
)
static

◆ operator<<() [3/3]

static raw_ostream& operator<< ( raw_ostream &  OS,
const SDWAOperand &  Operand 
)
static

Definition at line 849 of file SIPeepholeSDWA.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::SIInstrInfo::canShrink(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineBasicBlock::computeRegisterLiveness(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::count(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::RegState::Define, llvm::AMDGPU::SDWA::DWORD, E, llvm::SmallVectorBase::empty(), llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::explicit_uses(), findSingleRegUse(), llvm::MachineInstr::findTiedOperandIdx(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::GCNSubtarget::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::SIInstrInfo::getNamedOperand(), llvm::AMDGPU::getNamedOperandIdx(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getOperandNo(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::SIRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::GCNSubtarget::getRegisterInfo(), llvm::AMDGPU::getSDWAOp(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getSubtarget(), llvm::SIRegisterInfo::getVCC(), llvm::AMDGPU::getVOPe32(), llvm::SIInstrInfo::hasModifiersSet(), llvm::MachineRegisterInfo::hasOneUse(), llvm::AMDGPUSubtarget::hasSDWA(), llvm::GCNSubtarget::hasSDWAMac(), llvm::GCNSubtarget::hasSDWAOmod(), llvm::GCNSubtarget::hasSDWAOutModsVOPC(), llvm::GCNSubtarget::hasSDWAScalar(), llvm::GCNSubtarget::hasSDWASdst(), llvm::SIRegisterInfo::hasVGPRs(), I, llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::SIInstrInfo::isSDWA(), llvm::SIRegisterInfo::isSGPRReg(), llvm::SIRegisterInfo::isVGPR(), llvm::SIInstrInfo::isVOPC(), llvm::RegState::Kill, LLVM_DEBUG, llvm::MachineBasicBlock::LQR_Dead, MI, llvm::Mod, llvm::MCInstrDesc::OpInfo, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SIInstrInfo::pseudoToMCOpcode(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MCOperandInfo::RegClass, llvm::MipsISD::Ret, llvm::ARM_MB::ST, llvm::MachineInstr::tieOperands(), llvm::AMDGPU::SDWA::UNUSED_PAD, llvm::AMDGPU::SDWA::UNUSED_PRESERVE, and llvm::MachineRegisterInfo::use_empty().

◆ STATISTIC() [1/2]

STATISTIC ( NumSDWAPatternsFound  ,
"Number of SDWA patterns found."   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumSDWAInstructionsPeepholed  ,
"Number of instruction converted to SDWA."   
)