We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d85b35b commit 9d1ae9aCopy full SHA for 9d1ae9a
lib/SILOptimizer/LoopTransforms/COWArrayOpt.cpp
@@ -2292,9 +2292,16 @@ class SwiftArrayOptPass : public SILFunctionTransform {
2292
if (!ShouldSpecializeArrayProps)
2293
return;
2294
2295
+ auto *Fn = getFunction();
2296
+
2297
+ // Don't hoist array property calls at Osize.
2298
+ auto OptMode = Fn->getModule().getOptions().Optimization;
2299
+ if (OptMode == SILOptions::SILOptMode::OptimizeForSize)
2300
+ return;
2301
2302
DominanceAnalysis *DA = PM->getAnalysis<DominanceAnalysis>();
2303
SILLoopAnalysis *LA = PM->getAnalysis<SILLoopAnalysis>();
- SILLoopInfo *LI = LA->get(getFunction());
2304
+ SILLoopInfo *LI = LA->get(Fn);
2305
2306
bool HasChanged = false;
2307
0 commit comments