Skip to content

Commit 48b88b0

Browse files
committed
[micro-opt] Flip a check to improve perf.
1 parent 1821499 commit 48b88b0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/SILOptimizer/Mandatory/OptimizeHopToExecutor.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,12 @@ void OptimizeHopToExecutor::updateNeedExecutor(int &needExecutor,
342342
// 6.2, since caller isolation inheriting functions will no longer be
343343
// considered suspension points, we will be able to sink this code into needs
344344
// executor.
345-
if (auto isolation = inst->getFunction()->getActorIsolation();
346-
isolation && isolation->isCallerIsolationInheriting() &&
347-
isa<ReturnInst>(inst)) {
348-
needExecutor = BlockState::ExecutorNeeded;
349-
return;
345+
if (isa<ReturnInst>(inst)) {
346+
if (auto isolation = inst->getFunction()->getActorIsolation();
347+
isolation && isolation->isCallerIsolationInheriting()) {
348+
needExecutor = BlockState::ExecutorNeeded;
349+
return;
350+
}
350351
}
351352

352353
if (isSuspensionPoint(inst)) {

0 commit comments

Comments
 (0)