Description
Bugzilla Link | 44329 |
Version | trunk |
OS | Windows NT |
Attachments | Reproducer for SSA problem |
CC | @efriedma-quic,@rnk |
Extended Description
The SimplifyCFG utility doesn't correctly handle lifetime.end intrinsics when deleting empty WinEH cleanup pads. There are at least two issues.
-
The lifetime.end intrinsic is simply deleted with the empty cleanup pad. This leaves a path through the control graph in which a pointer appears to be alive longer than it should.
-
If the lifetime.end is the only user of a PHI node in the cleanup pad we will attempt to sink the PHI node into the cleanup pad's successor, which might not be dominated by the cleanup pad. If the PHI node had non-PHI users outside the cleanup pad this would be safe, but when the only user of the PHI node is a lifetime.end marker inside the cleanup pad it causes an SSA violation.
The attached IR file reproduces the second problem. The first problem can be seen in the existing (as of 12/17/2019) SimplifyCFG/empty-cleanuppad.ll test (in f9).