Files
swift-mirror/validation-test/SILOptimizer/rdar117011668.swift
Nate Chandler cea0f00598 [InstructionDeleter] Delete dead load [take]s.
Previously, `isScopeAffectingInstructionDead` determined that
an otherwise satisfactory `load` was not dead if it was a `load [take]`.
The immediate effect was that dead `load [take]`s were not deleted.  The
downstream effect was that otherwise dead graphs of instructions would
not be deleted.  This was especially a problem for OSLogOptimization
which deletes a great deal of code.

Here, the InstructionDeleter is taught to compensate for the deletion of
such `load [take]` by inserting `destroy_addr`s in their stead.

rdar://117011668
2023-11-01 14:42:28 -07:00

21 lines
561 B
Swift

// RUN: %target-swift-frontend -disable-availability-checking -emit-sil -verify %s | %FileCheck %s
// REQUIRES: objc_interop
import Foundation
import os.log
struct Log {
static let attachmentLedgerTopic = Logger(
subsystem: "com.xxx.yyy.zzz",
category: "ccc")
}
// CHECK-LABEL: sil @logWriter : {{.*}} {
// CHECK-NOT: $s2os18OSLogInterpolationV13appendLiteralyySSF
// CHECK-LABEL: } // end sil function 'logWriter'
@_silgen_name("logWriter")
public func logWriter(_ attachmentID: UUID) {
Log.attachmentLedgerTopic.info("aaa: \(attachmentID)")
}