swift
20e780cb - [move-function] Add support for loadable vars.

Commit
3 years ago
[move-function] Add support for loadable vars. This is done by extending the support in the previous PR for a. If we see the following pattern: ``` %0 = alloc_stack [lexical] $LoadableType, var ... *init of %0* ... %1 = load [copy] %0 : $*LoadableType %temporary = alloc_stack $LoadableType store %1 to [init] %temporary : $*LoadableType mark_unresolved_move_addr %temporary to %otherAddr : $*LoadableType destroy_addr %temporary : $*LoadableType ``` we transform it to: ``` %0 = alloc_stack [lexical] $LoadableType, var ... *init of %0* ... %1 = load [copy] %0 : $*LoadableType %temporary = alloc_stack $LoadableType store %2 to [init] %temporary : $*LoadableType mark_unresolved_move_addr %0 to %otherAddr : $*LoadableType destroy_addr %temporary : $*LoadableType ``` For safety reasons, we always make sure that %0 isn't destroyed in between the load [copy] and the mark_unresolved_move_addr. After this runs, we can use the address verifier on these types of vars with some additional work that I am doing in a subsequent commit. (cherry picked from commit 544b338baf0aacb4fe24115424384d688a9d6cdd)
Author
Committer
Parents
Loading