Previously, HandleLastUse would delete RegRef information for sub-registers if they were dead even if their corresponding super-register were still live. If the super-register were later renamed, then the definitions of the sub-register would not be updated appropriately. This patch alters the behavior so that RegInfo information for sub-registers is only deleted when the sub-register and super-register are both dead. This resolves PR26775. This is the mirror image of Hal's r227311 commit.
LGTM, thanks! -- Nice efficient patch :-) [I realize that I'm ruining that somewhat by asking for a comment ;) ]
|315 ↗||(On Diff #51557)|
Please add a comment here explaining why we do this only if the superregister was not live. Maybe something like this:
// Note that we only do this if the superregister was not live because otherwise, regardless whether we have an explicit use of the subregister, the subregister's contents are needed for the uses of the superregister.