This is an archive of the discontinued LLVM Phabricator instance.

RegisterCoalescer: Correctly set valid lanes when keeping live out implicit defs
ClosedPublic

Authored by arsenm on Aug 25 2023, 8:03 AM.

Details

Summary

This fixes some verifier errors when live out implicit defs are
coalesced with identity copies. Fixes some reduced testcases from
issue #38788 but doesn't solve the original failure.

I was surprised this seems to obviate the special casing in
analyzeValue that's been there since the subregister liveness support
went in.

Diff Detail

Event Timeline

arsenm created this revision.Aug 25 2023, 8:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 8:03 AM
arsenm requested review of this revision.Aug 25 2023, 8:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 8:03 AM
Herald added a subscriber: wdng. · View Herald Transcript
bjope added inline comments.Sep 7 2023, 1:00 PM
llvm/lib/CodeGen/RegisterCoalescer.cpp
2455

If I understand correctly (well I'm trying to understand things), this is needed since we now want to treat the IMPLICIT_DEF as an ordinary value. And some previously computed ValidLanes values would be incorrect as it has treated the IMPLICIT_DEF as producing undefined values so we originally did not care about those lanes?

arsenm added inline comments.Sep 7 2023, 1:54 PM
llvm/lib/CodeGen/RegisterCoalescer.cpp
2455

Yes. We would try to restore the valid lanes later, but that was less precise

ping, my Phabricator deadline is this week

foad added a comment.Sep 11 2023, 3:52 AM

This looks identical to D158882.

bjope added a comment.Sep 11 2023, 5:50 AM

This looks identical to D158882.

This is a parent to D158882. So I think it really is the other way around, that something happened with D158882, and that the real fix in that patch got lost somehow?

bjope accepted this revision.Sep 11 2023, 1:14 PM

LGTM

This revision is now accepted and ready to land.Sep 11 2023, 1:14 PM