This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ] Bugfix in shouldCoalesce()
ClosedPublic

Authored by jonpa on Nov 6 2018, 11:37 PM.

Details

Reviewers
kparzysz
uweigand
Summary

It was discovered in randomized testing that the SystemZ implementation of shouldCoalesce() could be caused to crash when subreg liveness was enabled. This was because an undef use of the virtual register was copied outside current MBB at the point of shouldCoalesce() being called. For more details, see https://bugs.llvm.org/show_bug.cgi?id=39276.

This patch changes the check for MBB locality from livein/liveout checks to do checks for all instructions of both intervals being inside MBB. This avoids the cases with dead defs / undef uses outside MBB, which are not affecting liveness in/out of MBB.

The original test case included as a reduced .mir test case.

Diff Detail

Event Timeline

jonpa created this revision.Nov 6 2018, 11:37 PM
uweigand accepted this revision.Nov 7 2018, 2:25 PM

LGTM, thanks!

This revision is now accepted and ready to land.Nov 7 2018, 2:25 PM
jonpa closed this revision.Nov 8 2018, 7:35 AM

r346406.