This is an archive of the discontinued LLVM Phabricator instance.

[RegisterCoalescer] Fix crash on early clobbered subreg operands.
ClosedPublic

Authored by dfukalov on Jun 6 2022, 11:07 AM.

Details

Summary

The issue was with processing two subregs of the same reg are used in the same
instruction (e.g. inline asm): "def early-clobber" and other just "def".
Register coalescer ran in bad recursion if the early clobbered subreg is second
in the following sequence of COPYs.

Diff Detail

Event Timeline

dfukalov created this revision.Jun 6 2022, 11:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:07 AM
dfukalov requested review of this revision.Jun 6 2022, 11:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:07 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Jun 7 2022, 7:09 PM
llvm/lib/CodeGen/RegisterCoalescer.cpp
2746–2749

Could use a comment

llvm/test/CodeGen/AMDGPU/coalescer-early-clobber-subreg.mir
8

Missing word between "and other"?

dfukalov updated this revision to Diff 435117.Jun 8 2022, 5:55 AM

Addressed comments.

dfukalov updated this revision to Diff 435542.Jun 9 2022, 7:30 AM

Beautified test.

arsenm accepted this revision.Jun 9 2022, 6:56 PM
This revision is now accepted and ready to land.Jun 9 2022, 6:56 PM
This revision was landed with ongoing or failed builds.Sep 5 2022, 10:42 PM
This revision was automatically updated to reflect the committed changes.