|
LLVM
10.0.0
|
#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/InitializePasses.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 2858 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 1657 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.
|
static |
Definition at line 2602 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 2625 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 assert(), contains(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::dbgs(), E, llvm::MachineFunction::front(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineOperand::getParent(), llvm::MachineInstr::getParent(), llvm::RegionBase< Tr >::getParent(), getParent(), getPHINumInputs(), getPHIPred(), getPHISourceReg(), llvm::SIInstrInfo::getPreferredSelectRegClass(), llvm::RegionInfoBase< Tr >::getRegionFor(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::RegionInfoBase< Tr >::getTopLevelRegion(), I, llvm::MachineBasicBlock::instr_end(), llvm::MachineOperand::isDef(), isLiveOut(), llvm::MachineInstr::isPHI(), llvm::Register::isPhysicalRegister(), llvm::Register::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(), llvm::MachineOperand::setReg(), SI, llvm::MachineBasicBlock::succ_size(), TII, TRI, and llvm::MachineRegisterInfo::use_operands().
|
static |
Definition at line 1281 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_size(), and llvm::MachineBasicBlock::terminators().
Referenced by fixupRegionExits().
|
static |
Definition at line 1294 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by fixupRegionExits().
| void fixupRegionExits | ( | RegionMRT * | Region | ) |
Definition at line 1343 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::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and llvm::MachineInstr::isPHI().
Referenced by fixupRegionExits(), 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(), 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(), and isPHIRegionIndex().
|
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(), and isPHIRegionIndex().
|
static |
Definition at line 1708 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by containsNewBackedge(), and hasOneExitNode().
|
static |
Definition at line 1723 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 2278 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::SIInstrInfo::analyzeBranch(), llvm::MachineFunction::begin(), llvm::MachineOperand::CreateReg(), llvm::MachineRegisterInfo::createVirtualRegister(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getParent(), llvm::MachineRegisterInfo::getRegClass(), llvm::SIInstrInfo::insertNE(), llvm::MachineBasicBlock::instr_end(), llvm::SIInstrInfo::removeBranch(), removeExternalCFGSuccessors(), and llvm::MachineFunction::splice().
Referenced by containsNewBackedge().
|
static |
Definition at line 1438 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 2592 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 1331 of file AMDGPUMachineCFGStructurizer.cpp.
Referenced by containsNewBackedge().
|
static |
Definition at line 1792 of file AMDGPUMachineCFGStructurizer.cpp.
References llvm::MachineBasicBlock::addSuccessor(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineOperand::CreateReg(), llvm::dbgs(), E, llvm::MachineBasicBlock::findDebugLoc(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineBasicBlock::getNumber(), llvm::MachineBasicBlock::getParent(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::MachineFunction::insert(), llvm::SIInstrInfo::insertEQ(), llvm::MachineBasicBlock::isSuccessor(), LLVM_DEBUG, llvm::SIInstrInfo::materializeImmediate(), llvm::MachineBasicBlock::pred_begin(), llvm::MachineBasicBlock::pred_end(), llvm::MachineBasicBlock::pred_size(), llvm::printMBBReference(), SI, llvm::MachineFunction::splice(), llvm::MachineBasicBlock::succ_begin(), llvm::MachineBasicBlock::succ_end(), and llvm::MachineBasicBlock::succ_size().
|
static |
Definition at line 1782 of file AMDGPUMachineCFGStructurizer.cpp.
References E, llvm::MachineBasicBlock::succ_begin(), and llvm::MachineBasicBlock::succ_end().
Referenced by isFunctionEntryBlock().
|
static |
Definition at line 2578 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().
|
static |
Definition at line 2522 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 2900 of file AMDGPUMachineCFGStructurizer.cpp.
Definition at line 2905 of file AMDGPUMachineCFGStructurizer.cpp.
|
static |
Definition at line 2783 of file AMDGPUMachineCFGStructurizer.cpp.
| amdgpu machine cfg structurizer |
Definition at line 2905 of file AMDGPUMachineCFGStructurizer.cpp.
Definition at line 2905 of file AMDGPUMachineCFGStructurizer.cpp.
1.8.13