This is an archive of the discontinued LLVM Phabricator instance.

Account for undef values from predecessors in extendSegmentsToUses
ClosedPublic

Authored by kparzysz on Jun 25 2018, 12:03 PM.

Details

Summary

It is legal for a PHI node not to have a live value in a predecessor as long as the end of the predecessor is jointly dominated by an undef value.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz created this revision.Jun 25 2018, 12:03 PM
kparzysz updated this revision to Diff 152745.Jun 25 2018, 12:15 PM

Added CHECK lines to the testcase (which was copied from D48546).

dstuttard accepted this revision.Jun 26 2018, 3:00 AM

Yes, this change looks better based on what you say about not requiring live-in's for undef sub-ranges.

Regarding cutting down the .mir test case. Presumably you're happy with the version you've copied across to this change (removing the unnecessary register classes)? I've already spent quite a lot of time reducing the test case as much as this - the problem is that it requires spilling to trigger the issue. Using -stress-regalloc worked to some extent, but couldn't be reduced further in this case - hence some of the extra code that doesn't directly impinge on the problem.

This revision is now accepted and ready to land.Jun 26 2018, 3:00 AM

The code itself is of a very reasonable size, I just meant removing the unnecessary fields from the machine function description, i.e. register classes (because they are specified inline), frame info, etc. Basically anything that is set to its default values. Testcases can be hard to generate for issues like this, so thank you for making effort to get them.