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,
144144 auto *predBB = Pair.first ;
145145 auto predArg = Pair.second ;
146146
147+ // We only want to consider values coming from a non-cold path of preds.
147148 if (isCold (predBB))
148149 continue ;
149150
150151 std::optional<bool > predecessorValue;
151152
153+ // Look for an integer literal, otherwise, recurse.
152154 if (auto *IL = dyn_cast<IntegerLiteralInst>(predArg)) {
153155 predecessorValue = IL->getValue ().getBoolValue ();
154156 } else {
@@ -274,6 +276,8 @@ void ColdBlockInfo::analyze(SILFunction *fn) {
274276 LLVM_DEBUG (llvm::dbgs () << " --> Before Stage 1\n " );
275277 LLVM_DEBUG (dump ());
276278
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.
277281 BasicBlockSet foundExpectedCond (fn);
278282
279283 // Stage 1: Seed the graph with warm/cold blocks.
You can’t perform that action at this time.
0 commit comments