LLVM 24.0.0git
StructurizeCFG.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "structurizecfg"

Functions

 INITIALIZE_PASS_BEGIN (StructurizeCFGLegacyPass, "structurizecfg", "Structurize the CFG", false, false) INITIALIZE_PASS_END(StructurizeCFGLegacyPass
static bool hasOnlyUniformBranches (Region *R, const UniformityInfo &UA)
 Can region R be left unstructurized because all of its own control flow is uniform?
static void addRegionIntoQueue (Region &R, std::vector< Region * > &Regions)
static bool runImpl (DominatorTree &DT, RegionInfo &RI, const TargetTransformInfo &TTI, UniformityInfo *UI)
 Structurize every region in RI, processing inner regions before the regions that contain them.

Variables

const char FlowBlockName [] = "Flow"
 structurizecfg
Structurize the CFG
Structurize the false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "structurizecfg"

Definition at line 56 of file StructurizeCFG.cpp.

Function Documentation

◆ addRegionIntoQueue()

void addRegionIntoQueue ( Region & R,
std::vector< Region * > & Regions )
static

Definition at line 1376 of file StructurizeCFG.cpp.

References addRegionIntoQueue(), and E().

Referenced by addRegionIntoQueue(), and runImpl().

◆ hasOnlyUniformBranches()

bool hasOnlyUniformBranches ( Region * R,
const UniformityInfo & UA )
static

Can region R be left unstructurized because all of its own control flow is uniform?

Only the terminators of direct child blocks are checked. Sub-regions are processed before their parent, so any divergent control flow inside a sub-region has already been structurized and is self-contained: it is entered only through the sub-region's entry, and it rejoins either at Flow blocks inside the sub-region or, if the sub-region's entry dominates its exit, at the exit block itself. Uniform control flow around a sub-region therefore does not need structurizing, whatever the sub-region contains. (The branches inside sub-regions could not be checked anyway, because they may have been removed and re-created since UniformityAnalysis ran.)

FIXME: This does not hold for a sub-region whose entry block ends in a callbr, because run() leaves such regions unstructurized.

Definition at line 1277 of file StructurizeCFG.cpp.

References E(), and llvm::none_of().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( StructurizeCFGLegacyPass ,
"structurizecfg" ,
"Structurize the CFG" ,
false ,
false  )

◆ runImpl()

bool runImpl ( DominatorTree & DT,
RegionInfo & RI,
const TargetTransformInfo & TTI,
UniformityInfo * UI )
static

Structurize every region in RI, processing inner regions before the regions that contain them.

If UI is non-null, skip uniform regions.

Definition at line 1395 of file StructurizeCFG.cpp.

References addRegionIntoQueue(), Changed, and llvm::RegionInfoBase< Tr >::getTopLevelRegion().

Variable Documentation

◆ CFG

Structurize the CFG

Definition at line 398 of file StructurizeCFG.cpp.

◆ false

Structurize the false

Definition at line 398 of file StructurizeCFG.cpp.

◆ FlowBlockName

const char FlowBlockName[] = "Flow"

Definition at line 59 of file StructurizeCFG.cpp.

◆ structurizecfg

structurizecfg

Definition at line 397 of file StructurizeCFG.cpp.