This is an archive of the discontinued LLVM Phabricator instance.

RegisterCoalescer: Prune undef subranges from copy pairs in loops
ClosedPublic

Authored by arsenm on Dec 10 2020, 1:11 PM.

Details

Summary

If we had a pair of copies inside a loop which introduced new liveness
to a subregister which was undef before the loop, we would have a
dummy phi-only segment remaining across the loop body. Later, this
false segment would confuse RenameIndependentSubregs causing it to
introduce IMPLICIT_DEFs with broken value numbering.

It seems always adding the lanes to ShrinkMask is OK, so any
conditions should be purely a compile time filter.

Diff Detail

Event Timeline

arsenm created this revision.Dec 10 2020, 1:11 PM
arsenm requested review of this revision.Dec 10 2020, 1:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 1:11 PM
Herald added a subscriber: wdng. · View Herald Transcript
qcolombet accepted this revision.Feb 3 2021, 10:16 AM

LGTM with nit on the function name.

llvm/lib/CodeGen/RegisterCoalescer.cpp
3120

I don't really like the function name here:
We don't test for undef and we don't have anything specific for subrange.

Maybe rename in isLiveThrough?

This revision is now accepted and ready to land.Feb 3 2021, 10:16 AM