LLVM  8.0.1
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/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_ostreamoperator<< (raw_ostream &OS, SdwaSel Sel)
 
static raw_ostreamoperator<< (raw_ostream &OS, const DstUnused &Un)
 
static raw_ostreamoperator<< (raw_ostream &OS, const SDWAOperand &Operand)
 
static void copyRegOperand (MachineOperand &To, const MachineOperand &From)
 
static bool isSameReg (const MachineOperand &LHS, const MachineOperand &RHS)
 
static MachineOperandfindSingleRegUse (const MachineOperand *Reg, const MachineRegisterInfo *MRI)
 
static MachineOperandfindSingleRegDef (const MachineOperand *Reg, const MachineRegisterInfo *MRI)
 

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

Definition at line 317 of file SIPeepholeSDWA.cpp.

References llvm::SISrcMods::ABS, llvm::MachineInstrBuilder::add(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::AMDGPU::SDWA::BYTE_0, llvm::AMDGPU::SDWA::BYTE_1, llvm::AMDGPU::SDWA::BYTE_2, llvm::AMDGPU::SDWA::BYTE_3, llvm::SIInstrInfo::canShrink(), llvm::MachineOperand::ChangeToRegister(), llvm::MachineBasicBlock::computeRegisterLiveness(), copyRegOperand(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::tgtok::Def, llvm::MachineRegisterInfo::def_operands(), llvm::RegState::Define, llvm::MachineInstr::defs(), 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::getNamedImmOperand(), 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(), getReg(), llvm::MachineFunction::getRegInfo(), llvm::GCNSubtarget::getRegisterInfo(), llvm::AMDGPU::getSDWAOp(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getUniqueVRegDef(), 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::RegState::ImplicitKill, llvm::SIInstrInfo::isFoldableCopy(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), isSameReg(), 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::SISrcMods::NEG, llvm::None, llvm::MCInstrDesc::OpInfo, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MCOperandInfo::RegClass, llvm::MachineBasicBlock::remove(), llvm::MipsISD::Ret, llvm::MachineOperand::setImm(), llvm::SISrcMods::SEXT, llvm::ARM_MB::ST, llvm::MachineInstr::tieOperands(), llvm::AMDGPU::SDWA::UNUSED_PAD, llvm::AMDGPU::SDWA::UNUSED_PRESERVE, llvm::MachineRegisterInfo::use_empty(), llvm::MachineRegisterInfo::use_nodbg_instructions(), llvm::MachineInstr::uses(), llvm::AMDGPU::SDWA::WORD_0, and llvm::AMDGPU::SDWA::WORD_1.

◆ 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 247 of file SIPeepholeSDWA.cpp.

References LLVM_DUMP_METHOD, and print().

◆ STATISTIC() [1/2]

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

◆ STATISTIC() [2/2]

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