Commit Graph

3 Commits

Author SHA1 Message Date
Nate Chandler
5513dd1e32 [SAO] Redundant move elimination is mandatory. 2023-12-14 13:35:26 -08:00
Nate Chandler
ceb941d1d1 [NFC] Extracted isRedundantMoveValue.
Extracted the predicate from inline in RedundantMoveValueElimination
into the new function which can now be called from elsewhere
(CopyPropagation).
2023-03-15 07:38:59 -07:00
Nate Chandler
5f561ed596 [SAO] Add RedundantMoveValueElimination.
Adds to SemanticARCOpts a new step of removing move_value instructions
if they are redundant.  A move_value is redundant if it adds no new
information or optimization opportunities.

An example of adding information: a lifetime becoming lexical.  The new
lifetime's destroys cannot be hoisted over deinit barriers.

An example of adding an optimization opportunity: the original value
escapes but the value produced by the move_value does not escape.  So
destroys of the new value can be hoisted more aggressively.
2023-03-10 10:49:53 -08:00