Commit Graph

6 Commits

Author SHA1 Message Date
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
Erik Eckstein
da0dea1ffb tests: adapt some optimizer tests for rebranch
rdar://133510613
2024-08-09 10:59:17 +02:00
Erik Eckstein
eb626c2814 ObjectOutliner: don't outline objects with tail allocations
An object with tail allocated elements is in risk of being passed to malloc_size, which does not work for non-heap allocated objects.
Conservatively, disable objects with tail allocations.

rdar://121886093
2024-01-31 16:25:21 +01:00
Erik Eckstein
cb768c20d7 tests: re-enable and fix SILOptimizer/static_objects.swift
rdar://120802375
2024-01-11 13:01:17 +01:00
Allan Shortlidge
cdd7b52a9d Temporarily disable test/SILOptimizer/static_objects.swift. 2024-01-10 16:43:40 -08:00
Erik Eckstein
fa3a959524 ObjectOutliner: support outlining of classes in global let variables
```
  let c = SomeClass()
```

is turned into

```
  private let outlinedVariable = SomeClass()  // statically initialized and allocated in the data section
  let c = outlinedVariable
```

rdar://111021230
rdar://115502043

Also, make the ObjectOutliner work for OSSA. Though, it currently doesn't run in the OSSA pipeline.
2024-01-10 09:34:01 +01:00