Skip to content

Commit b8e183e

Browse files
authored
Merge pull request #78496 from meg-gupta/cpremoveossaflag
[6.1] Fix build option for Synchronization and Distributed
2 parents b9e1fdb + ebf32ce commit b8e183e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3169,9 +3169,12 @@ static AllocationInst *getOptimizableAllocation(SILInstruction *i) {
31693169
}
31703170

31713171
bool 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

32113214
bool swift::eliminateDeadAllocations(SILFunction *fn, DominanceInfo *domInfo) {
3215+
if (!fn->hasOwnership()) {
3216+
return false;
3217+
}
32123218
bool changed = false;
32133219
DeadEndBlocks deadEndBlocks(fn);
32143220

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ function(add_swift_target_library name)
20642064
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-lexical-lifetimes=false")
20652065
endif()
20662066

2067-
if (NOT DEFINED IMPORTS_NON_OSSA)
2067+
if (NOT SWIFTLIB_IMPORTS_NON_OSSA)
20682068
list(APPEND SWIFTLIB_SWIFT_COMPILE_FLAGS "-Xfrontend;-enable-ossa-modules")
20692069
endif()
20702070

test/SILOptimizer/stdlib/Atomics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33
// REQUIRES: synchronization
44

0 commit comments

Comments
 (0)