File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
lib/SILOptimizer/Analysis Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -144,11 +144,13 @@ ColdBlockInfo::searchForExpectedValue(SILValue Cond,
144
144
auto *predBB = Pair.first ;
145
145
auto predArg = Pair.second ;
146
146
147
+ // We only want to consider values coming from a non-cold path of preds.
147
148
if (isCold (predBB))
148
149
continue ;
149
150
150
151
std::optional<bool > predecessorValue;
151
152
153
+ // Look for an integer literal, otherwise, recurse.
152
154
if (auto *IL = dyn_cast<IntegerLiteralInst>(predArg)) {
153
155
predecessorValue = IL->getValue ().getBoolValue ();
154
156
} else {
@@ -274,6 +276,8 @@ void ColdBlockInfo::analyze(SILFunction *fn) {
274
276
LLVM_DEBUG (llvm::dbgs () << " --> Before Stage 1\n " );
275
277
LLVM_DEBUG (dump ());
276
278
279
+ // The set of blocks for which we can skip searching for an expected
280
+ // conditional value, as we've already determined which successor is cold.
277
281
BasicBlockSet foundExpectedCond (fn);
278
282
279
283
// Stage 1: Seed the graph with warm/cold blocks.
You can’t perform that action at this time.
0 commit comments