@@ -76,18 +76,18 @@ private func isNotReferenceCounted(value: Value, context: PassContext) -> Bool {
7676 return isNotReferenceCounted ( value: uci. operand, context: context)
7777 case let urc as UncheckedRefCastInst :
7878 return isNotReferenceCounted ( value: urc. operand, context: context)
79- case is GlobalValueInst :
79+ case let gvi as GlobalValueInst :
8080 // Since Swift 5.1, statically allocated objects have "immortal" reference
8181 // counts. Therefore we can safely eliminate unbalaced retains and
8282 // releases, because they are no-ops on immortal objects.
8383 // Note that the `simplifyGlobalValuePass` pass is deleting balanced
8484 // retains/releases, which doesn't require a Swift 5.1 minimum deployment
8585 // targert.
86- return context . isSwift51RuntimeAvailable
86+ return gvi . function . isSwift51RuntimeAvailable
8787 case let rptr as RawPointerToRefInst :
8888 // Like `global_value` but for the empty collection singletons from the
8989 // stdlib, e.g. the empty Array singleton.
90- if context . isSwift51RuntimeAvailable {
90+ if rptr . function . isSwift51RuntimeAvailable {
9191 // The pattern generated for empty collection singletons is:
9292 // %0 = global_addr @_swiftEmptyArrayStorage
9393 // %1 = address_to_pointer %0
0 commit comments