mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Beside fixing the compiler crash, this change also improves the stack-nesting correction mechanisms in the inliners: * Instead of trying to correct the nesting after each inlining of a callee, correct the nesting once when inlining is finished for a caller function. This fixes a potential compile time problem, because StackNesting iterates over the whole function. In worst case this can lead to quadratic behavior in case many begin_apply instructions with overlapping stack locations are inlined. * Because we are doing it only once for a caller, we can remove the complex logic for checking if it is necessary. We can just do it unconditionally in case any coroutine gets inlined. The inliners iterate over all instruction of a function anyway, so this does not increase the computational complexity (StackNesting is roughly linear with the number of instructions). rdar://problem/47615442
5.0 KiB
5.0 KiB