Skip to content

Commit 8e86d0f

Browse files
committed
IRGen: always execute the coroutine lowering pass
Do not gate the coroutine extension points on the LLVM passes. Without running this pass, the generated IR cannot be used by the LLVM tooling. This allows generating the LLVM IR to debug issues in the LLVM backend. I encountered this when trying to isolate a debug info generation bug which seems to be caused by the SRoA pass in LLVM. By allowing to emit the LLVM IR without the LLVM optimizations, it is possible to isolate the LLVM pass operation via `opt` from LLVM.
1 parent 0f86137 commit 8e86d0f

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

lib/IRGen/IRGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts,
221221
addSwiftContractPass);
222222
}
223223

224-
if (RunSwiftSpecificLLVMOptzns)
224+
if (!Opts.DisableSwiftSpecificLLVMOptzns)
225225
addCoroutinePassesToExtensionPoints(PMBuilder);
226226

227227
if (Opts.Sanitizers & SanitizerKind::Address) {

test/IRGen/modifyaccessor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -primary-file %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns -primary-file %s | %FileCheck %s
22
extension Dictionary {
33
subscript(alternate key: Key) -> Value? {
44
get {

test/IRGen/yield_once.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth
22

33
import Builtin
44

test/IRGen/yield_once_big.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
22

33
import Builtin
44
import Swift

test/IRGen/yield_once_biggish.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
22

33
// i386 uses a scalar result count of 3 instead of 4, so this test would need
44
// to be substantially different to test the functionality there. It's easier

test/IRGen/yield_once_indirect.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
1+
// RUN: %target-swift-frontend -emit-ir -disable-llvm-optzns -disable-swift-specific-llvm-optzns %s | %FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-%target-ptrsize --check-prefix=CHECK-%target-ptrsize-%target-ptrauth -DINT=i%target-ptrsize
22

33
import Builtin
44
import Swift

0 commit comments

Comments
 (0)