LLVM 20.0.0git
Macros | Functions | Variables
AMDGPUMachineCFGStructurizer.cpp File Reference
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegionInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/InitializePasses.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "amdgpucfgstructurizer"
 

Functions

static unsigned getPHINumInputs (MachineInstr &PHI)
 
static MachineBasicBlockgetPHIPred (MachineInstr &PHI, unsigned Index)
 
static void setPhiPred (MachineInstr &PHI, unsigned Index, MachineBasicBlock *NewPred)
 
static unsigned getPHISourceReg (MachineInstr &PHI, unsigned Index)
 
static unsigned getPHIDestReg (MachineInstr &PHI)
 
static unsigned createBBSelectReg (const SIInstrInfo *TII, MachineRegisterInfo *MRI)
 
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 MachineBasicBlockgetSingleExitNode (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 MachineBasicBlocksplit (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
 
char AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID
 
amdgpu machine cfg structurizer
 
amdgpu machine cfg AMDGPU Machine CFG Structurizer
 
amdgpu machine cfg AMDGPU Machine CFG false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpucfgstructurizer"

Definition at line 28 of file AMDGPUMachineCFGStructurizer.cpp.

Function Documentation

◆ checkRegOnlyPHIInputs()

static void checkRegOnlyPHIInputs ( MachineFunction MF)
static

◆ collectPHIs()

static void collectPHIs ( MachineBasicBlock MBB,
SmallVector< MachineInstr *, 2 > &  PHIs 
)
static

◆ containsNewBackedge() [1/2]

static bool containsNewBackedge ( MRT *  Tree,
SmallPtrSet< MachineBasicBlock *, 8 > &  MBBs 
)
static

◆ containsNewBackedge() [2/2]

static bool containsNewBackedge ( RegionMRT *  Region)
static

Definition at line 2566 of file AMDGPUMachineCFGStructurizer.cpp.

References containsNewBackedge().

◆ createBBSelectReg()

static unsigned createBBSelectReg ( const SIInstrInfo TII,
MachineRegisterInfo MRI 
)
static

Definition at line 597 of file AMDGPUMachineCFGStructurizer.cpp.

References MRI, and TII.

◆ fixMBBTerminator()

static void fixMBBTerminator ( MachineBasicBlock MBB)
static

◆ fixRegionTerminator()

static void fixRegionTerminator ( RegionMRT *  Region)
static

Definition at line 1265 of file AMDGPUMachineCFGStructurizer.cpp.

References assert().

Referenced by fixupRegionExits().

◆ fixupRegionExits()

void fixupRegionExits ( RegionMRT *  Region)

Definition at line 1311 of file AMDGPUMachineCFGStructurizer.cpp.

References fixMBBTerminator(), and fixRegionTerminator().

◆ getPHIDestReg()

static unsigned getPHIDestReg ( MachineInstr PHI)
static

Definition at line 304 of file AMDGPUMachineCFGStructurizer.cpp.

References assert(), and PHI.

◆ getPHINumInputs()

static unsigned getPHINumInputs ( MachineInstr PHI)
static

Definition at line 284 of file AMDGPUMachineCFGStructurizer.cpp.

References assert(), and PHI.

Referenced by checkRegOnlyPHIInputs().

◆ getPHIPred()

static MachineBasicBlock * getPHIPred ( MachineInstr PHI,
unsigned  Index 
)
static

Definition at line 289 of file AMDGPUMachineCFGStructurizer.cpp.

References assert(), and PHI.

◆ getPHISourceReg()

static unsigned getPHISourceReg ( MachineInstr PHI,
unsigned  Index 
)
static

Definition at line 299 of file AMDGPUMachineCFGStructurizer.cpp.

References assert(), and PHI.

◆ getSingleExitNode()

static MachineBasicBlock * getSingleExitNode ( MachineFunction MF)
static

Definition at line 1670 of file AMDGPUMachineCFGStructurizer.cpp.

Referenced by hasOneExitNode().

◆ hasOneExitNode()

static bool hasOneExitNode ( MachineFunction MF)
static

Definition at line 1685 of file AMDGPUMachineCFGStructurizer.cpp.

References getSingleExitNode().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPUMachineCFGStructurizer  ,
"amdgpu-machine-cfg-structurizer"  ,
"AMDGPU Machine CFG Structurizer"  ,
false  ,
false   
)

◆ isFunctionEntryBlock()

static bool isFunctionEntryBlock ( MachineBasicBlock MBB)
static

◆ isPHIRegionIndex()

static bool isPHIRegionIndex ( SmallVector< unsigned, 2 >  PHIRegionIndices,
unsigned  Index 
)
static

Definition at line 1406 of file AMDGPUMachineCFGStructurizer.cpp.

References llvm::is_contained().

◆ mbbHasBackEdge()

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

◆ regionIsSequence()

bool regionIsSequence ( RegionMRT *  Region)

Definition at line 1299 of file AMDGPUMachineCFGStructurizer.cpp.

◆ removeExternalCFGEdges()

static void removeExternalCFGEdges ( MachineBasicBlock StartMBB,
MachineBasicBlock EndMBB 
)
static

◆ removeExternalCFGSuccessors()

static void removeExternalCFGSuccessors ( MachineBasicBlock MBB)
static

◆ removeOldExitPreds()

static void removeOldExitPreds ( RegionMRT *  Region)
static

◆ setPhiPred()

static void setPhiPred ( MachineInstr PHI,
unsigned  Index,
MachineBasicBlock NewPred 
)
static

Definition at line 294 of file AMDGPUMachineCFGStructurizer.cpp.

References PHI.

◆ split()

static MachineBasicBlock * split ( MachineBasicBlock::iterator  I)
static

Variable Documentation

◆ AMDGPUMachineCFGStructurizerID

char AMDGPUMachineCFGStructurizerID = AMDGPUMachineCFGStructurizer::ID

Definition at line 2827 of file AMDGPUMachineCFGStructurizer.cpp.

◆ false

amdgpu machine cfg AMDGPU Machine CFG false

Definition at line 2833 of file AMDGPUMachineCFGStructurizer.cpp.

◆ structurize_once

int structurize_once = 0
static

Definition at line 2718 of file AMDGPUMachineCFGStructurizer.cpp.

◆ structurizer

amdgpu machine cfg structurizer

Definition at line 2832 of file AMDGPUMachineCFGStructurizer.cpp.

◆ Structurizer

amdgpu machine cfg AMDGPU Machine CFG Structurizer

Definition at line 2833 of file AMDGPUMachineCFGStructurizer.cpp.