LLVM
8.0.1
|
#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>
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 raw_ostream & | operator<< (raw_ostream &OS, const SDWAOperand &Operand) |
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) |
#define DEBUG_TYPE "si-peephole-sdwa" |
Definition at line 57 of file SIPeepholeSDWA.cpp.
|
static |
Definition at line 276 of file SIPeepholeSDWA.cpp.
References assert(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUndef(), llvm::MachineOperand::isUse(), llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsUndef(), llvm::MachineOperand::setReg(), and llvm::MachineOperand::setSubReg().
Referenced by findSingleRegDef().
|
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.
|
static |
Definition at line 295 of file SIPeepholeSDWA.cpp.
References llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isReg(), isSameReg(), and llvm::MachineRegisterInfo::use_nodbg_operands().
Referenced by findSingleRegDef().
|
static |
Definition at line 288 of file SIPeepholeSDWA.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), and llvm::MachineOperand::isReg().
Referenced by findSingleRegDef(), and findSingleRegUse().
|
static |
Definition at line 225 of file SIPeepholeSDWA.cpp.
References llvm::AMDGPU::SDWA::BYTE_0, llvm::AMDGPU::SDWA::BYTE_1, llvm::AMDGPU::SDWA::BYTE_2, llvm::AMDGPU::SDWA::BYTE_3, llvm::AMDGPU::SDWA::DWORD, llvm::AMDGPU::SDWA::WORD_0, and llvm::AMDGPU::SDWA::WORD_1.
|
static |
Definition at line 238 of file SIPeepholeSDWA.cpp.
References llvm::AMDGPU::SDWA::UNUSED_PAD, llvm::AMDGPU::SDWA::UNUSED_PRESERVE, and llvm::AMDGPU::SDWA::UNUSED_SEXT.
|
static |
Definition at line 247 of file SIPeepholeSDWA.cpp.
References LLVM_DUMP_METHOD, and print().
STATISTIC | ( | NumSDWAPatternsFound | , |
"Number of SDWA patterns found." | |||
) |
STATISTIC | ( | NumSDWAInstructionsPeepholed | , |
"Number of instruction converted to SDWA." | |||
) |