File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3169,9 +3169,12 @@ static AllocationInst *getOptimizableAllocation(SILInstruction *i) {
3169
3169
}
3170
3170
3171
3171
bool swift::optimizeMemoryAccesses (SILFunction *fn) {
3172
+ if (!fn->hasOwnership ()) {
3173
+ return false ;
3174
+ }
3175
+
3172
3176
bool changed = false ;
3173
3177
DeadEndBlocks deadEndBlocks (fn);
3174
-
3175
3178
InstructionDeleter deleter;
3176
3179
for (auto &bb : *fn) {
3177
3180
for (SILInstruction &inst : bb.deletableInstructions ()) {
@@ -3209,6 +3212,9 @@ bool swift::optimizeMemoryAccesses(SILFunction *fn) {
3209
3212
}
3210
3213
3211
3214
bool swift::eliminateDeadAllocations (SILFunction *fn, DominanceInfo *domInfo) {
3215
+ if (!fn->hasOwnership ()) {
3216
+ return false ;
3217
+ }
3212
3218
bool changed = false ;
3213
3219
DeadEndBlocks deadEndBlocks (fn);
3214
3220
Original file line number Diff line number Diff line change @@ -2064,7 +2064,7 @@ function(add_swift_target_library name)
2064
2064
list (APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false" )
2065
2065
endif ()
2066
2066
2067
- if (NOT DEFINED IMPORTS_NON_OSSA )
2067
+ if (NOT SWIFTLIB_IMPORTS_NON_OSSA )
2068
2068
list (APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules" )
2069
2069
endif ()
2070
2070
Original file line number Diff line number Diff line change 1
- // RUN: %target-swift-frontend -enable-ossa-modules - O -emit-sil -disable-availability-checking %s | %IRGenFileCheck %s
1
+ // RUN: %target-swift-frontend -O -emit-sil -disable-availability-checking %s | %IRGenFileCheck %s
2
2
3
3
// REQUIRES: synchronization
4
4
You can’t perform that action at this time.
0 commit comments