Files
swift-mirror/lib/SILOptimizer/Transforms/SILCodeMotion.cpp
Erik Eckstein b80a08ee6c CodeMotion: check the ownership of arguments when sinking arguments
So far we only checked the ownership of incoming values.
But even if the incoming instruction has no ownership, the argument may have.
This can happen with enums which are constructed with a non-payload case:

   %1 = enum $Optional<C>, #Optional.none!enumelt
   br bb3(%1)
 bb1(%3 : @owned $Optional<C>):

Fixes an ownership verification error:
rdar://142506300
2025-01-09 19:56:25 +01:00

65 KiB