LLVM
8.0.1
|
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.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/MachineRegionInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <tuple>
#include <utility>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "amdgpucfgstructurizer" |
Variables | |
static int | structurize_once = 0 |
char | AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID |
amdgpu machine cfg | structurizer |
amdgpu machine cfg AMDGPU Machine CFG | Structurizer |
amdgpu machine cfg AMDGPU Machine CFG | false |
#define DEBUG_TYPE "amdgpucfgstructurizer" |
Definition at line 47 of file AMDGPUMachineCFGStructurizer.cpp.
|
static |
Definition at line 2856 of file AMDGPUMachineCFGStructurizer.cpp.
References assert(), llvm::dbgs(), llvm::MachineFunction::dump(), E, llvm::GCNSubtarget::getInstrInfo(), llvm::MachineInstr::getOperand(), getPHINumInputs(), llvm::MachineFunction::getRegInfo(), llvm::GCNSubtarget::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), I, llvm::MachineInstr::isPHI(), llvm::MachineOperand::isReg(), LLVM_DEBUG, and llvm::ARM_MB::ST.
|
static |
Definition at line 1655 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::dbgs(), llvm::MachineBasicBlock::getFirstInstrTerminator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::instr_end(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::MCID::Terminator.
Referenced by isFunctionEntryBlock().
|
static |
Definition at line 2600 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::SmallPtrSetImpl< PtrType >::insert(), mbbHasBackEdge(), llvm::SetVector< T, Vector, Set >::rbegin(), and llvm::SetVector< T, Vector, Set >::rend().
Referenced by containsNewBackedge().
|
static |
Definition at line 2623 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineFunction::begin(), containsNewBackedge(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::SIInstrInfo::convertNonUniformLoopRegion(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::MachineBasicBlock::findDebugLoc(), fixupRegionExits(), llvm::MachineBasicBlock::getFirstNonPHI(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getParent(), llvm::MachineRegisterInfo::getRegClass(), getSingleExitNode(), llvm::SIInstrInfo::insertReturn(), isFunctionEntryBlock(), LLVM_DEBUG, llvm::SIInstrInfo::materializeImmediate(), llvm::printReg(), regionIsSequence(), and removeOldExitPreds().
|
static |
Definition at line 618 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::AnalysisUsage::addRequired(), assert(), contains(), llvm::SIInstrInfo::convertNonUniformIfRegion(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::tgtok::Def, llvm::MachineRegisterInfo::def_begin(), llvm::MachineRegisterInfo::def_end(), llvm::dump(), E, llvm::MachineFunction::front(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::RegionBase< Tr >::getParent(), getParent(), llvm::PassRegistry::getPassRegistry(), getPHINumInputs(), getPHIPred(), getPHISourceReg(), llvm::SIInstrInfo::getPreferredSelectRegClass(), llvm::RegionInfoBase< Tr >::getRegionFor(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::RegionInfoBase< Tr >::getTopLevelRegion(), llvm::MachineRegisterInfo::hasOneDef(), I, llvm::initializeAMDGPUMachineCFGStructurizerPass(), llvm::MachineBasicBlock::insert(), llvm::MachineBasicBlock::instr_end(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isKill(), isLiveOut(), llvm::MachineInstr::isPHI(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::TargetRegisterInfo::isVirtualRegister(), LLVM_DEBUG, llvm_unreachable, MRI, llvm::RISCVFenceField::O, llvm::post_order(), print(), llvm::printMBBReference(), llvm::printReg(), llvm::MachineRegisterInfo::reg_begin(), llvm::MachineRegisterInfo::reg_end(), Register, llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setReg(), SI, llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), llvm::MachineBasicBlock::succ_size(), TII, TRI, and llvm::MachineRegisterInfo::use_operands().
|
static |
Definition at line 1279 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_size(), and llvm::MachineBasicBlock::terminators().
Referenced by fixupRegionExits().
|
static |
Definition at line 1292 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by fixupRegionExits().
void fixupRegionExits | ( | RegionMRT * | Region | ) |
Definition at line 1341 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::MachineInstr::dump(), E, fixMBBTerminator(), fixRegionTerminator(), llvm::MachineInstr::getDebugLoc(), getPHIDestReg(), getPHINumInputs(), getPHIPred(), getPHISourceReg(), llvm::MachineRegisterInfo::getRegClass(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineBasicBlock::instr_begin(), llvm::MachineBasicBlock::instr_end(), llvm::MachineInstr::isPHI(), LLVM_DEBUG, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by containsNewBackedge().
|
static |
Definition at line 323 of file AMDGPUMachineCFGStructurizer.cpp.
References assert(), llvm::SetVector< T, Vector, Set >::back(), llvm::SetVector< T, Vector, Set >::begin(), contains(), llvm::dbgs(), llvm::dump(), llvm::SetVector< T, Vector, Set >::front(), llvm::MachineInstr::getOperand(), getParent(), llvm::MachineOperand::getReg(), llvm::SetVector< T, Vector, Set >::insert(), isLiveOut(), llvm::MachineInstr::isPHI(), P, print(), llvm::printReg(), Reg, Register, TII, and TRI.
Referenced by fixupRegionExits(), isFunctionEntryBlock(), and isPHIRegionIndex().
|
static |
Definition at line 303 of file AMDGPUMachineCFGStructurizer.cpp.
References assert(), llvm::MachineInstr::getNumOperands(), and llvm::MachineInstr::isPHI().
Referenced by checkRegOnlyPHIInputs(), createBBSelectReg(), fixupRegionExits(), isFunctionEntryBlock(), and isPHIRegionIndex().
|
static |
Definition at line 308 of file AMDGPUMachineCFGStructurizer.cpp.
References assert(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOperand(), and llvm::MachineInstr::isPHI().
Referenced by createBBSelectReg(), fixupRegionExits(), isFunctionEntryBlock(), isPHIRegionIndex(), and removeExternalCFGEdges().
|
static |
Definition at line 318 of file AMDGPUMachineCFGStructurizer.cpp.
References assert(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::MachineInstr::isPHI().
Referenced by createBBSelectReg(), fixupRegionExits(), isFunctionEntryBlock(), isPHIRegionIndex(), and removeExternalCFGEdges().
|
static |
Definition at line 1706 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by containsNewBackedge(), and hasOneExitNode().
|
static |
Definition at line 1721 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), llvm::MachineFunction::end(), llvm::MachineBasicBlock::findDebugLoc(), llvm::MachineBasicBlock::getNumber(), getSingleExitNode(), llvm::MachineFunction::insert(), llvm::MachineBasicBlock::instr_begin(), LLVM_DEBUG, llvm::printMBBReference(), llvm::printReg(), llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), and llvm::RegState::Undef.
INITIALIZE_PASS_BEGIN | ( | AMDGPUMachineCFGStructurizer | , |
"amdgpu-machine-cfg-structurizer" | , | ||
"AMDGPU Machine CFG Structurizer" | , | ||
false | , | ||
false | |||
) |
|
static |
Definition at line 2276 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::SIInstrInfo::analyzeBranch(), assert(), llvm::MachineFunction::begin(), llvm::BuildMI(), collectPHIs(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineOperand::CreateReg(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::MachineInstr::getDebugLoc(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getParent(), getPHIDestReg(), getPHINumInputs(), getPHIPred(), getPHISourceReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::insert(), llvm::SIInstrInfo::insertBranch(), llvm::SIInstrInfo::insertNE(), llvm::MachineBasicBlock::instr_begin(), llvm::MachineBasicBlock::instr_end(), llvm::MachineInstr::isPHI(), LLVM_DEBUG, print(), llvm::printMBBReference(), llvm::printReg(), llvm::SIInstrInfo::removeBranch(), removeExternalCFGSuccessors(), setPhiPred(), llvm::SmallVectorBase::size(), and llvm::MachineFunction::splice().
Referenced by containsNewBackedge().
|
static |
Definition at line 1436 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::dbgs(), llvm::MachineInstr::dump(), E, llvm::MachineInstr::eraseFromParent(), llvm::MachineInstr::getDebugLoc(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), getPHIDestReg(), getPHINumInputs(), getPHIPred(), getPHISourceReg(), IsDead, LLVM_DEBUG, llvm::printMBBReference(), llvm::printReg(), llvm::MachineRegisterInfo::use_begin(), and llvm::MachineRegisterInfo::use_end().
|
static |
Definition at line 2590 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::SmallPtrSetImpl< PtrType >::count(), SI, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
Referenced by containsNewBackedge().
bool regionIsSequence | ( | RegionMRT * | Region | ) |
Definition at line 1329 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by containsNewBackedge().
|
static |
Definition at line 1790 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::SIInstrInfo::analyzeBranch(), assert(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineOperand::CreateReg(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), llvm::tgtok::Def, llvm::MachineRegisterInfo::def_begin(), llvm::MachineRegisterInfo::def_end(), E, llvm::MachineInstr::eraseFromParent(), llvm::MachineBasicBlock::findDebugLoc(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getParent(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), getParent(), getPHIPred(), getPHISourceReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::MachineRegisterInfo::hasOneDef(), I, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::MachineFunction::insert(), llvm::SIInstrInfo::insertBranch(), llvm::SIInstrInfo::insertEQ(), llvm::SIInstrInfo::insertVectorSelect(), llvm::MachineBasicBlock::instr_begin(), llvm::MachineInstr::isPHI(), llvm::TargetRegisterInfo::isPhysicalRegister(), isReg(), llvm::MachineBasicBlock::isSuccessor(), LLVM_DEBUG, llvm_unreachable, llvm::SIInstrInfo::materializeImmediate(), llvm::RISCVFenceField::O, llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), llvm::MachineBasicBlock::pred_size(), llvm::printMBBReference(), llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), Reg, llvm::MachineRegisterInfo::reg_begin(), llvm::MachineRegisterInfo::reg_end(), llvm::MachineOperand::setReg(), SI, llvm::SmallVectorBase::size(), llvm::Sched::Source, llvm::MachineFunction::splice(), llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), llvm::MachineBasicBlock::succ_size(), llvm::MachineRegisterInfo::use_begin(), and llvm::MachineRegisterInfo::use_end().
|
static |
Definition at line 1780 of file AMDGPUMachineCFGStructurizer.cpp.
References E, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
Referenced by isFunctionEntryBlock().
|
static |
Definition at line 2576 of file AMDGPUMachineCFGStructurizer.cpp.
References E, llvm::MachineBasicBlock::pred_begin(), and llvm::MachineBasicBlock::pred_end().
Referenced by containsNewBackedge().
|
static |
Definition at line 313 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineInstr::getOperand(), and llvm::MachineOperand::setMBB().
Referenced by isFunctionEntryBlock().
|
static |
Definition at line 2520 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::MCID::Branch, llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getFirstNonPHI(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), I, llvm::MachineFunction::insert(), LLVM_DEBUG, llvm::printMBBReference(), llvm::MachineBasicBlock::splice(), llvm::MachineBasicBlock::transferSuccessorsAndUpdatePHIs(), and llvm::MachineInstr::uses().
char AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID |
Definition at line 2898 of file AMDGPUMachineCFGStructurizer.cpp.
Definition at line 2903 of file AMDGPUMachineCFGStructurizer.cpp.
|
static |
Definition at line 2781 of file AMDGPUMachineCFGStructurizer.cpp.
amdgpu machine cfg structurizer |
Definition at line 2903 of file AMDGPUMachineCFGStructurizer.cpp.
Definition at line 2903 of file AMDGPUMachineCFGStructurizer.cpp.