Skip to content

Commit 49adf11

Browse files
committed
[cfg] Add back in bool return value, returning a value to it this time.
1 parent b77374a commit 49adf11

File tree

2 files changed

+7
-2
lines changed
  • include/swift/SILOptimizer/Utils
  • lib/SILOptimizer/Utils

2 files changed

+7
-2
lines changed

include/swift/SILOptimizer/Utils/CFG.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool splitAllCriticalEdges(SILFunction &F, bool OnlyNonCondBr,
131131
///
132132
/// A current invariant of Ownership SIL is that cond_br can only have critical
133133
/// edges with non-trivial arguments. This simplifies computation.
134-
void splitAllCondBrCriticalEdgesWithNonTrivialArgs(SILFunction &F,
134+
bool splitAllCondBrCriticalEdgesWithNonTrivialArgs(SILFunction &Fn,
135135
DominanceInfo *DT,
136136
SILLoopInfo *LI);
137137

lib/SILOptimizer/Utils/CFG.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ void swift::completeJointPostDominanceSet(
931931
copy(MustVisitSuccessorBlocks, std::back_inserter(Result));
932932
}
933933

934-
void swift::splitAllCondBrCriticalEdgesWithNonTrivialArgs(SILFunction &Fn,
934+
bool swift::splitAllCondBrCriticalEdgesWithNonTrivialArgs(SILFunction &Fn,
935935
DominanceInfo *DT,
936936
SILLoopInfo *LI) {
937937
// Find our targets.
@@ -955,11 +955,16 @@ void swift::splitAllCondBrCriticalEdgesWithNonTrivialArgs(SILFunction &Fn,
955955
Targets.emplace_back(&Block, CondBranchInst::FalseIdx);
956956
}
957957

958+
if (Targets.empty())
959+
return false;
960+
958961
for (auto P : Targets) {
959962
SILBasicBlock *Block = P.first;
960963
unsigned Index = P.second;
961964
auto *Result = splitCriticalEdge(Block->getTerminator(), Index, DT, LI);
962965
(void)Result;
963966
assert(Result);
964967
}
968+
969+
return true;
965970
}

0 commit comments

Comments
 (0)