Commit Graph

2 Commits

Author SHA1 Message Date
Erik Eckstein
a19ae5c1c5 [concurrency] Correctly handle dead-end and unreachable blocks in OptimizeHopToExecutor
Fixes an infinite loop.

rdar://problem/71544153
2020-11-19 13:10:50 +01:00
Erik Eckstein
a47ebabe54 [concurrency] SILOptimizer: optimize hop_to_executor instructions.
* Redundant hop_to_executor elimination: if a hop_to_executor is dominated by another hop_to_executor with the same operand, it is eliminated:

      hop_to_executor %a
      ... // no suspension points
      hop_to_executor %a // can be eliminated

* Dead hop_to_executor elimination: if a hop_to_executor is not followed by any code which requires to run on its actor's executor, it is eliminated:

      hop_to_executor %a
      ... // no instruction which require to run on %a
      return

rdar://problem/70304809
2020-11-05 18:48:22 +01:00