LLVM  5.0.0
Macros | Functions | Variables
AMDGPUMachineCFGStructurizer.cpp File Reference
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.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/Analysis/CFG.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegionInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <tuple>
Include dependency graph for AMDGPUMachineCFGStructurizer.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpucfgstructurizer"
 

Functions

static void fixMBBTerminator (MachineBasicBlock *MBB)
 
static void fixRegionTerminator (RegionMRT *Region)
 
bool regionIsSequence (RegionMRT *Region)
 
void fixupRegionExits (RegionMRT *Region)
 
static bool isPHIRegionIndex (SmallVector< unsigned, 2 > PHIRegionIndices, unsigned Index)
 
static void collectPHIs (MachineBasicBlock *MBB, SmallVector< MachineInstr *, 2 > &PHIs)
 
static MachineBasicBlock * getSingleExitNode (MachineFunction &MF)
 
static bool hasOneExitNode (MachineFunction &MF)
 
static void removeExternalCFGSuccessors (MachineBasicBlock *MBB)
 
static void removeExternalCFGEdges (MachineBasicBlock *StartMBB, MachineBasicBlock *EndMBB)
 
static bool isFunctionEntryBlock (MachineBasicBlock *MBB)
 
static MachineBasicBlock * split (MachineBasicBlock::iterator I)
 
static void removeOldExitPreds (RegionMRT *Region)
 
static bool mbbHasBackEdge (MachineBasicBlock *MBB, SmallPtrSet< MachineBasicBlock *, 8 > &MBBs)
 
static bool containsNewBackedge (MRT *Tree, SmallPtrSet< MachineBasicBlock *, 8 > &MBBs)
 
static bool containsNewBackedge (RegionMRT *Region)
 
static void checkRegOnlyPHIInputs (MachineFunction &MF)
 
 INITIALIZE_PASS_BEGIN (AMDGPUMachineCFGStructurizer,"amdgpu-machine-cfg-structurizer","AMDGPU Machine CFG Structurizer", false, false) INITIALIZE_PASS_END(AMDGPUMachineCFGStructurizer
 

Variables

static int structurize_once = 0
 
amdgpu machine cfg structurizer
 
amdgpu machine cfg AMDGPU
Machine CFG 
Structurizer
 
amdgpu machine cfg AMDGPU
Machine CFG 
false
 
amdgpu machine cfg AMDGPU
Machine CFG false char 
AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID
 

Macro Definition Documentation

#define DEBUG_TYPE   "amdgpucfgstructurizer"

Definition at line 38 of file AMDGPUMachineCFGStructurizer.cpp.

Function Documentation

static void checkRegOnlyPHIInputs ( MachineFunction &  MF)
static
static void collectPHIs ( MachineBasicBlock *  MBB,
SmallVector< MachineInstr *, 2 > &  PHIs 
)
static
static bool containsNewBackedge ( MRT *  Tree,
SmallPtrSet< MachineBasicBlock *, 8 > &  MBBs 
)
static
static bool containsNewBackedge ( RegionMRT *  Region)
static

Definition at line 2594 of file AMDGPUMachineCFGStructurizer.cpp.

References containsNewBackedge().

static void fixMBBTerminator ( MachineBasicBlock *  MBB)
static
static void fixRegionTerminator ( RegionMRT *  Region)
static
void fixupRegionExits ( RegionMRT *  Region)

Definition at line 1319 of file AMDGPUMachineCFGStructurizer.cpp.

References fixMBBTerminator(), and fixRegionTerminator().

static MachineBasicBlock* getSingleExitNode ( MachineFunction &  MF)
static

Definition at line 1683 of file AMDGPUMachineCFGStructurizer.cpp.

Referenced by hasOneExitNode().

static bool hasOneExitNode ( MachineFunction &  MF)
static

Definition at line 1698 of file AMDGPUMachineCFGStructurizer.cpp.

References getSingleExitNode().

INITIALIZE_PASS_BEGIN ( AMDGPUMachineCFGStructurizer  ,
"amdgpu-machine-cfg-structurizer"  ,
"AMDGPU Machine CFG Structurizer"  ,
false  ,
false   
)
static bool isFunctionEntryBlock ( MachineBasicBlock *  MBB)
static
static bool isPHIRegionIndex ( SmallVector< unsigned, 2 >  PHIRegionIndices,
unsigned  Index 
)
static

Definition at line 1414 of file AMDGPUMachineCFGStructurizer.cpp.

static bool mbbHasBackEdge ( MachineBasicBlock *  MBB,
SmallPtrSet< MachineBasicBlock *, 8 > &  MBBs 
)
static
bool regionIsSequence ( RegionMRT *  Region)

Definition at line 1307 of file AMDGPUMachineCFGStructurizer.cpp.

static void removeExternalCFGEdges ( MachineBasicBlock *  StartMBB,
MachineBasicBlock *  EndMBB 
)
static
static void removeExternalCFGSuccessors ( MachineBasicBlock *  MBB)
static
static void removeOldExitPreds ( RegionMRT *  Region)
static
static MachineBasicBlock* split ( MachineBasicBlock::iterator  I)
static

Variable Documentation

amdgpu machine cfg AMDGPU Machine CFG false char AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID

Definition at line 2851 of file AMDGPUMachineCFGStructurizer.cpp.

amdgpu machine cfg AMDGPU Machine CFG false

Definition at line 2848 of file AMDGPUMachineCFGStructurizer.cpp.

int structurize_once = 0
static

Definition at line 2752 of file AMDGPUMachineCFGStructurizer.cpp.

amdgpu machine cfg structurizer

Definition at line 2848 of file AMDGPUMachineCFGStructurizer.cpp.

amdgpu machine cfg AMDGPU Machine CFG Structurizer

Definition at line 2848 of file AMDGPUMachineCFGStructurizer.cpp.