Files
swift-mirror/test/SILOptimizer/loweraggregateinstrs_resilience.sil
Erik Eckstein 7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00

32 lines
1.2 KiB
Plaintext

// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -lower-aggregate-instrs -enable-library-evolution | %FileCheck %s
// This file makes sure that given the current code-size metric we properly
// expand operations for small structs and not for large structs in a consistent
// way for all operations we expand.
sil_stage canonical
import Swift
import Builtin
public struct ResilientStruct {
var x: AnyObject
}
// CHECK-LABEL: sil @$test_retain_release : $@convention(thin) (@in_guaranteed ResilientStruct) -> ()
// CHECK: retain_value %2 : $(ResilientStruct, ResilientStruct)
// CHECK-NEXT: release_value %2 : $(ResilientStruct, ResilientStruct)
// CHECK-NEXT: release_value %2 : $(ResilientStruct, ResilientStruct)
// CHECK: return
sil @$test_retain_release : $@convention(thin) (@in_guaranteed ResilientStruct) -> () {
bb0(%0 : $*ResilientStruct):
%1 = load %0 : $*ResilientStruct
%3 = tuple (%1 : $ResilientStruct, %1 : $ResilientStruct)
retain_value %3 : $(ResilientStruct, ResilientStruct)
release_value %3 : $(ResilientStruct, ResilientStruct)
release_value %3 : $(ResilientStruct, ResilientStruct)
%result = tuple ()
return %result : $()
}