Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ class ControlFlowConversionState::Impl : public ControlFlowConversionState {
Instruction *persistedCombinedDivergentExitMask = nullptr;
};

/// @brief Create loop masks for the specified loop and its subloops.
/// @param[in] L Loop which should have its LoopMasksInfo created.
void createLoopMasks(Loop *L);

/// @brief Convert the function's CFG to data-flow.
/// @return true if the function's CFG was converted, false otherwise.
bool convertToDataFlow();
Expand Down Expand Up @@ -538,6 +542,13 @@ bool ControlFlowConversionState::replaceReachableUses(Reachability &RC,
return true;
}

void ControlFlowConversionState::Impl::createLoopMasks(Loop *L) {
LoopMasks[L];
for (auto *L : L->getSubLoops()) {
createLoopMasks(L);
}
}

bool ControlFlowConversionState::Impl::convertToDataFlow() {
DT = &AM.getResult<DominatorTreeAnalysis>(F);
PDT = &AM.getResult<PostDominatorTreeAnalysis>(F);
Expand All @@ -546,7 +557,7 @@ bool ControlFlowConversionState::Impl::convertToDataFlow() {

// Make sure every loop has an entry in the masks table before we start.
for (auto *L : *LI) {
LoopMasks[L];
createLoopMasks(L);
}

if (!VU.choices().linearizeBOSCC()) {
Expand Down