LLVM  6.0.0svn
Macros | Functions
SIPeepholeSDWA.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIDefines.h"
#include "SIInstrInfo.h"
#include "SIRegisterInfo.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/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, const 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 55 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 313 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::MachineOperand::ChangeToRegister(), copyRegOperand(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), DEBUG, llvm::tgtok::Def, llvm::MachineRegisterInfo::def_operands(), llvm::RegState::Define, llvm::MachineInstr::defs(), llvm::AMDGPU::SDWA::DWORD, llvm::SmallVectorBase::empty(), llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::explicit_uses(), findSingleRegUse(), llvm::MachineInstr::getDebugLoc(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getImm(), llvm::SISubtarget::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::MachineInstr::getParent(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), getReg(), llvm::MachineFunction::getRegInfo(), llvm::SISubtarget::getRegisterInfo(), llvm::AMDGPU::getSDWAOp(), llvm::MachineOperand::getSubReg(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::getUniqueVRegDef(), llvm::AMDGPU::getVOPe32(), llvm::SIInstrInfo::hasModifiersSet(), llvm::AMDGPUSubtarget::hasSDWA(), llvm::AMDGPUSubtarget::hasSDWAMac(), llvm::AMDGPUSubtarget::hasSDWAOmod(), llvm::AMDGPUSubtarget::hasSDWAOutModsVOPC(), llvm::AMDGPUSubtarget::hasSDWAScalar(), llvm::AMDGPUSubtarget::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, MI, llvm::Mod, llvm::SISrcMods::NEG, llvm::None, llvm::MCInstrDesc::OpInfo, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::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::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,
const 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 243 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."   
)