This is an archive of the discontinued LLVM Phabricator instance.

RegisterCoalescer: Remove phi-only subranges when erasing identity copies
ClosedPublic

Authored by arsenm on Dec 4 2020, 9:42 AM.

Details

Summary

Undef subranges are not present in the live range values, except when
they cross block boundaries. In this situation, a identity copy is
inside a loop, and one of the lanes is undefined. It only appears
alive inside the loop due to the copy. Once the copy was erased, it
would leave behind a segment inside the loop body with no
corresponding def anywhere in the program.

When RenameIndependentSubregs processed this dummy interval, it would
introduce a "Multiple connected components in live interval" verifier
error when IMPLICIT_DEFs were added to the other two blocks. I believe
there is a missing verifier check for this type of dummy interval.

I have found additional cases from the same fundamental problem in
other areas I haven't managed to fix yet (e.g. the commented out
prune_subrange_phi_value_* cases).

Diff Detail

Event Timeline

arsenm created this revision.Dec 4 2020, 9:42 AM
arsenm requested review of this revision.Dec 4 2020, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 9:42 AM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec accepted this revision.Dec 7 2020, 3:40 PM

I think I've seen similar cases before. LGTM, but will be nice if @qcolombet will look at this too.

This revision is now accepted and ready to land.Dec 7 2020, 3:40 PM
qcolombet accepted this revision.Dec 15 2020, 2:01 PM