Commit Graph

6 Commits

Author SHA1 Message Date
Meghana Gupta
037c095490 Disable a swift test for simplifycfg 2023-08-22 15:54:11 -07:00
Meghana Gupta
695a3b5c2e Update tests 2023-08-17 10:33:26 -07:00
Erik Eckstein
eea471fe99 add the ComputeEffects pass
The ComputeEffects pass derives escape information for function arguments and adds those effects in the function.
This needs a lot of changes in check-lines in the tests, because the effects are printed in SIL
2022-04-22 09:50:07 +02:00
Saleem Abdulrasool
218ef587e6 Revert "Merge pull request #42242 from eeckstein/escapeinfo"
This reverts commit c05e064cd8, reversing
changes made to c1534d5af9.

This caused a regression on Windows.
2022-04-21 20:33:37 -07:00
Erik Eckstein
700412b39e add the ComputeEffects pass
The ComputeEffects pass derives escape information for function arguments and adds those effects in the function.
This needs a lot of changes in check-lines in the tests, because the effects are printed in SIL
2022-04-21 08:45:08 +02:00
Arnold Schwaighofer
5298f81249 SimplifyCFG: Simplify switch_enum on optional classes used by objc method calls
In the statement

  optional1?.objc_setter = optional2?.objc_getter?.objc_getter

we can eliminate all optional switches expect for the first switch on
optional1. We must only execute the setter if optional1 has some value.

We can simplify the following switch_enum with a branch as long all
sideffecting instructions in someBB are objc_method calls on the
optional payload or on another objc_method call that transitively uses
the payload.

 switch_enum %optionalValue, case #Optional.some!enumelt.1: someBB,
                             case #Optional.none: noneBB

 someBB(%optionalPayload):
    %1 = objc_method %optionalPayload
    %2 = apply %1(..., %optionalPayload) // self position
    br mergeBB(%2)

 noneBB:
    %4 = enum #Optional.none
    br mergeBB(%4)

rdar://48007302
2019-02-28 13:39:25 -08:00