Skip to content

Commit be6239a

Browse files
committed
Fix should optimize logic
1 parent 37fae30 commit be6239a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/SILOptimizer/IPO/GlobalOpt.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,14 +1147,7 @@ bool SILGlobalOpt::run() {
11471147
// Optimize based on what we just collected.
11481148
for (auto &InitCalls : GlobalInitCallMap) {
11491149
// Don't optimize functions that are marked with the opt.never attribute.
1150-
bool shouldOptimize = true;
1151-
for (auto *apply : InitCalls.second) {
1152-
if (!apply->getFunction()->shouldOptimize()) {
1153-
shouldOptimize = false;
1154-
break;
1155-
}
1156-
}
1157-
if (!shouldOptimize)
1150+
if (!InitCalls.first->shouldOptimize())
11581151
continue;
11591152

11601153
// Optimize the addressors if possible.

0 commit comments

Comments
 (0)