Swift compile time regression with optimizations enabled

Originator:brady
Number:rdar://50353228 Date Originated:4/1/2019
Status: Resolved:
Product:Xcode Product Version:10.2.1
Classification: Reproducible:Always
 
Summary: We have a file that took seconds to compile in Xcode 10.1 that now takes 40 minutes to compile in Xcode 10.2. This is blocking our team from updating to the latest version of Xcode.


Steps to Reproduce: 1. Download the attached Strings.swift file
2. Run the following command:

time swiftc -O Strings.swift \
    -o output.o \
    -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk \
    -target arm64-apple-ios12.2


Expected Results: File compiles within seconds.


Actual Results: Wait 30+ minutes for the file to compile.


Version/Build: Xcode 10.2 and 10.2.1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!