This is an archive of the discontinued LLVM Phabricator instance.

[TwoAddrInst] Emit COPYs for undef REG_SEQUENCE operands if used in inst with early-clobber defs
AbandonedPublic

Authored by abinavpp on Sep 21 2022, 2:56 AM.

Details

Summary

We can have REG_SEQUENCE with IMPLICIT_DEF subregs that are used in
early-clobber instructions. TwoAddrInst should emit a copy for them when
trying to remove the REG_SEQUENCE so that regalloc doesn't assign
overlapping registers.

Diff Detail

Event Timeline

abinavpp created this revision.Sep 21 2022, 2:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 2:56 AM
abinavpp requested review of this revision.Sep 21 2022, 2:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 2:56 AM

I don't understand this. I would expect that you can always remove a %X.subY = COPY undef %Z statement and nothing changes, why do early-clobber users have any effect on that?

arsenm added inline comments.Sep 22 2022, 6:11 AM
llvm/test/CodeGen/AMDGPU/twoaddr-mad-gfx11.mir
18

I also don't understand how this helps. This is just IMPLICIT_DEF

24

Can get rid of the (s32)