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
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.
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.