mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Canonicalize a `fix_lifetime` from an address to a `load` + `fix_lifetime`: ``` %1 = alloc_stack $T ... fix_lifetime %1 ``` -> ``` %1 = alloc_stack $T ... %2 = load %1 fix_lifetime %2 ``` This transformation is done for `alloc_stack` and `store_borrow` (which always has an `alloc_stack` operand). The benefit of this transformation is that it enables other optimizations, like mem2reg. This peephole optimization was already done in SILCombine, but it didn't handle store_borrow. A good opportunity to make an instruction simplification out of it. This is part of fixing regressions when enabling OSSA modules: rdar://140229560
1.8 KiB
1.8 KiB