swift
dbc7842b - [Mem2Reg] Undef types in empty projection sources.

Commit
1 year ago
[Mem2Reg] Undef types in empty projection sources. Mem2Reg may materialize the unique instance of empty types when promoting an address of that empty type. Previously, it was required that the top-most type in the aggregate be empty. This failed to handle the case where a projection of empty type from a non-empty aggregate was promoted. For example: ``` %addr = alloc_stack $((), C) %empty_addr = tuple_element_addr $addr : $*((), C), 0 %addr = load %empty_addr : $*() ``` where `C` is some non-empty type. Here, that case is handled by using `undef` for each non-empty field in the projected-from aggregate. In the example, ``` %empty = tuple () %tuple = tuple (%empty : $(), undef : $C) %empty_again = tuple_extract %tuple : $((), C), 0 ``` rdar://122417297
Author
Committer
Parents
Loading