swift
79bc4cba - [Mem2Reg] Lexical allocs create lexical borrows.

Commit
3 years ago
[Mem2Reg] Lexical allocs create lexical borrows. SILGen turns vars into alloc_boxes. When possible, AllocBoxToStack turns those into alloc_stacks. In order to preserve the lexical lifetime of those vars, the alloc_stacks are annotated with the [lexical] attribute. When Mem2Reg runs, it promotes the loads from and stores into those alloc_stacks to uses of registers. In order to preserve the lexical lifetime during that transformation, lexical borrow scopes must be introduces that encode the same lifetime as the alloc_stacks did. Here, that is done.
Author
Committer
Parents
  • lib/SILOptimizer/Transforms
    • File
      SILMem2Reg.cpp
  • test/SILOptimizer
    • mem2reg_lifetime.sil
Loading