You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was playing around with one of the benchmark game programs and ran into a few performance edge cases.
The first was that marking a method as public caused inlining behaviour to change even in `-wmo` mode. Compare the effects of marking `dot` as `public`:
even though it should be a no-op. This can easily be observed by e.g. changing line 57 from `let posi = bodyi.pos` to `let posi = Vec4(bodyi.pos)`.
The third is that changing `System` from a `struct` to a `class` (https://godbolt.org/z/tJSudD) increases execution time from 2.56 to 3.43 on my computer, when it should have no change on the behaviour.
Attachment: Download
Additional Detail from JIRA
md5: 731e1a7fdbe90e0a2521ffee436d04ed
Issue Description:
I was playing around with one of the benchmark game programs and ran into a few performance edge cases.
The first was that marking a method as public caused inlining behaviour to change even in `-wmo` mode. Compare the effects of marking `dot` as `public`:
https://godbolt.org/z/WPZtHx (internal) vs https://godbolt.org/z/QcurxC (public). When `dot` is marked as public, `addingProduct` does not get inlined.
The second issue I noticed was that calling `SIMD4<Double>.init(_ value: SIMD4<Double>)` causes a bunch of calls to:
(generic specialization <Swift.Double> of generic partial specialization <serialized, Signature = @escaping @convention(thin) @convention(method) <A><A1 where A == Swift.Double, A1: Swift.BinaryFloatingPoint> (@in_guaranteed A1, @unowned @thick Swift.Double.Type) -> (@out Swift.Double, @unowned Swift.Bool)> of static (extension in Swift):Swift.BinaryFloatingPoint._convert<A where A1: Swift.BinaryFloatingPoint>(from: A1) -> (value: A, exact: Swift.Bool))
even though it should be a no-op. This can easily be observed by e.g. changing line 57 from `let posi = bodyi.pos` to `let posi = Vec4(bodyi.pos)`.
The third is that changing `System` from a `struct` to a `class` (https://godbolt.org/z/tJSudD) increases execution time from 2.56 to 3.43 on my computer, when it should have no change on the behaviour.
The test case:
main.swift with compile flags `-Ounchecked -wmo -Xllvm -unroll-count=5 -Xllvm -unroll-threshold=500 -Xcc -march=native -Xcc -ffast-math -Xcc -mavx2`
This was all tested with Swift 5.2 dev, commit 2007515
The text was updated successfully, but these errors were encountered: