swift
3508d414 - [Mem2Reg] Skip load [take] of cast projections.

Commit
3 years ago
[Mem2Reg] Skip load [take] of cast projections. Already, load [take]s of struct_element_addr|tuple_element_addr projections resulted in Mem2Reg bailing. Expand that to include load [take]s involving unchecked_addr_cast. To handle load [take]s of (struct|tuple)_element_addr projections, it would be necessary to replace the running value with a value obtained from the original product by recursive destructuring, replacing the value at the load [take]n address with undef, and then restructuring. To handle load [take]s of cast projections, it would be necessary to use unchecked_value_cast instead of unchecked_bitwise_cast. But we would need to still use unchecked_bitwise_cast in the case of load [copy] because otherwise we would lose the original value--unchecked_value_cast forwards ownership, and not all casts can be reversed (because they may narrow). For now, just bail out in the face of these complex load [take]s.
Author
Committer
Parents
Loading