-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
SILOptimizerArea → compiler: SIL optimization passesArea → compiler: SIL optimization passesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfembeddedEmbedded SwiftEmbedded Swiftperformanceswift 6.1unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Description
When compiling in Full Swift mode, UnsafeMutablePointer
’s update(from:count:)
emits a call to memmove()
. But in Embedded mode, a less performant explicit loop is emitted.
Reproduction
func f(dst: UnsafeMutablePointer<Int>, src: UnsafePointer<Int>) {
dst.update(from: src, count: 123)
}
Godbolt: https://godbolt.org/z/s71Mxfoz5
Expected behavior
A call to memmove()
is emitted.
Environment
Swift Development Snapshot 2024-08-03
Additional information
No response
Metadata
Metadata
Assignees
Labels
SILOptimizerArea → compiler: SIL optimization passesArea → compiler: SIL optimization passesbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfembeddedEmbedded SwiftEmbedded Swiftperformanceswift 6.1unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output