Commit Graph

10 Commits

Author SHA1 Message Date
Erik Eckstein
ba4081ee76 Optimizer: replace PredictableMemoryAccessOptimizations with MandatoryRedundantLoadElimination in the pass pipeline
PredictableMemoryAccessOptimizations has become unmaintainable as-is.
RedundantLoadElimination does (almost) the same thing as PredictableMemoryAccessOptimizations.
It's not as powerful but good enough because PredictableMemoryAccessOptimizations is actually only needed for promoting integer values for mandatory constant propagation.
And most importantly: RedundantLoadElimination does not insert additional copies which was a big problem in PredictableMemoryAccessOptimizations.

Fixes rdar://142814676
2025-02-07 11:30:35 +01:00
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
Michael Gottesman
645cac487e [sil-combine] Enable even more tests that we pass now. 2021-01-28 12:10:16 -08:00
Slava Pestov
9ec80df97e SIL: Remove curried SILDeclRefs 2020-03-19 02:20:21 -04:00
Andrew Trick
ba03bef27e Fix test cases for SILGen after removing critical edges. 2018-10-19 23:14:17 -07:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Joe Shajrawi
683c21bf9f XFAIL pointer_conversion_objc without asserts 2018-03-22 14:35:16 -07:00
Michael Gottesman
ac1bcb9b5c Re-enable test. It isn't failing anymore.
I think what happened here is that I originally was trying to change /all/
select_enum+cond_br to switch_enum. This implied I needed to change
SILGenFunction::emitBindOptional to use switch_enum. This caused all sorts of
problems since SILGenLValue uses emitBindOptional in a matter that requires the
input value to be used at +0 and wants to keep the value in memory. This
conflicted with other uses of emitBindOptional that really wanted to use
emitBindOptional as a +1 extract optional payload sort of thing. In the final
commit of +0-all-args, I just worked around this problem by creating a new
entrypoint just for the lvalue case that just uses select_enum_addr. So I think
my final commit, caused this test to go back to its original state. If it fails
again, I will look at it again.

rdar://38551973
2018-03-21 10:23:51 -07:00
Andrew Trick
c2aba9a3be Disable pointer_conversion_objc.swift 2018-03-16 11:35:02 -07:00
Michael Gottesman
dde4f58625 [+0-all-args] Change emitBindOptional to use a switch_enum instead of a select_enum. 2018-03-15 17:28:57 -07:00