swift
bf496aa4 - Optimizer: add simplification for fix_lifetime

Commit
1 year ago
Optimizer: add simplification for fix_lifetime 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
Author
Parents
Loading