File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
lib/SILOptimizer/Mandatory Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3169,9 +3169,12 @@ static AllocationInst *getOptimizableAllocation(SILInstruction *i) {
31693169}
31703170
31713171bool swift::optimizeMemoryAccesses (SILFunction *fn) {
3172+ if (!fn->hasOwnership ()) {
3173+ return false ;
3174+ }
3175+
31723176 bool changed = false ;
31733177 DeadEndBlocks deadEndBlocks (fn);
3174-
31753178 InstructionDeleter deleter;
31763179 for (auto &bb : *fn) {
31773180 for (SILInstruction &inst : bb.deletableInstructions ()) {
@@ -3209,6 +3212,9 @@ bool swift::optimizeMemoryAccesses(SILFunction *fn) {
32093212}
32103213
32113214bool swift::eliminateDeadAllocations (SILFunction *fn, DominanceInfo *domInfo) {
3215+ if (!fn->hasOwnership ()) {
3216+ return false ;
3217+ }
32123218 bool changed = false ;
32133219 DeadEndBlocks deadEndBlocks (fn);
32143220
Original file line number Diff line number Diff line change @@ -2072,7 +2072,7 @@ function(add_swift_target_library name)
20722072 list (APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false" )
20732073 endif ()
20742074
2075- if (NOT DEFINED IMPORTS_NON_OSSA )
2075+ if (NOT SWIFTLIB_IMPORTS_NON_OSSA )
20762076 list (APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules" )
20772077 endif ()
20782078
You can’t perform that action at this time.
0 commit comments