This is an archive of the discontinued LLVM Phabricator instance.

RegAllocGreedy: Fix crash when setting CostPerUse
AbandonedPublic

Authored by arsenm on Sep 11 2015, 12:20 PM.

Details

Reviewers
qcolombet
MatzeB
Summary

When CostPerUse is non-zero and tryAssign was attempting
to assign an undef VirtReg, the empty VirtReg LiveInterval would
assert in intervalIsInOneMBB.

This happens when I attempt to make the cost of all registers
except VCC have a CostPerUse of 1 on AMDGPU.

I'm not sure I will ever commit that change, because I'm not sure
it's exactly what I want. This results in overly aggressive
VCC usage instead of the relatively few operands where it is
advantageous to use it.

The testcase is the simplest case I've found where this happens
from a branch on undef, but only with the CopyCost change applied.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 34570.Sep 11 2015, 12:20 PM
arsenm retitled this revision from to RegAllocGreedy: Fix crash when setting CostPerUse.
arsenm updated this object.
arsenm added reviewers: qcolombet, MatzeB.
arsenm added a subscriber: llvm-commits.
qcolombet edited edge metadata.Sep 11 2015, 12:45 PM

Hi Matt,

I am not sure I understand how we end up in this situation.
How can we try to select a register for an empty live-range. Those cases are supposed to be sorted out before we try selectOrSplit.

Could you describe how we end up in this situation?

Thanks,
-Quentin

Hi Matt,

Is this change still relevant?

If not, could you close it?

Thanks,
-Quentin

arsenm abandoned this revision.Mar 9 2016, 9:21 PM

Closing for now. I'll reopen if I hit this again when trying to improve vcc usage