Page MenuHomePhabricator

[LiveInterval] Removed bogus empty subrange assert
Needs ReviewPublic

Authored by tpr on Tue, Jun 18, 12:27 PM.

Details

Reviewers
MatzeB
qcolombet
Summary

stripValuesNotDefiningMask was asserting that it did not leave an empty
subrange. However that was bogus because the subrange could have been
empty to start with, in the case that LiveRangeCalc::calculate saw a
subreg use that caused a subrange to be created empty.

Change-Id: Ibf862415ea422198975cc7a2ca2d98531beec08d

Diff Detail

Event Timeline

tpr created this revision.Tue, Jun 18, 12:27 PM
arsenm added a subscriber: arsenm.Tue, Jun 18, 12:35 PM
arsenm added inline comments.
test/CodeGen/AMDGPU/empty-subrange.mir
1

Should be restricted to a narrow range of passes in regalloc

9–41

This should be reduced more

tpr marked an inline comment as done.Wed, Jun 19, 2:28 AM
tpr added inline comments.
test/CodeGen/AMDGPU/empty-subrange.mir
1

I tried capturing mir just before the live intervals before regalloc, which is the one where it fell over, and running from there, but it did not reproduce the failure. I think it is too sensitive to what order it sees the MOs when iterating, which would be potentially different between reading a mir file and getting real output from earlier passes.

arsenm added inline comments.Wed, Jun 19, 11:57 AM
test/CodeGen/AMDGPU/empty-subrange.mir
1

This makes getting this test reduced even more important then. You've dropped all of the machineFunctionInfo, maybe some of those fields help? Spending hours debugging why I couldn't reproduce something like this is why I finally implemented the serialization for it. We don't preserve everything that matters yet

tpr marked an inline comment as done.Wed, Jun 19, 12:00 PM
tpr added inline comments.
test/CodeGen/AMDGPU/empty-subrange.mir
1

No; I chopped the machineFunctionInfo out after attempting to reproduce at various stages.

tpr added a comment.Wed, Jun 19, 12:04 PM

For this bug, whatever we do with a mir test, it is not going to be reliable in failing if the bug is present. Maybe there is a unit testing framework for LiveRangeCalc tests that I could add a test to.

In D63510#1550843, @tpr wrote:

For this bug, whatever we do with a mir test, it is not going to be reliable in failing if the bug is present. Maybe there is a unit testing framework for LiveRangeCalc tests that I could add a test to.

It's a pain to reduce, but it's usually possible with -stress-regalloc