This is an archive of the discontinued LLVM Phabricator instance.

[SplitKit] Cope with no live subranges in defFromParent
ClosedPublic

Authored by foad on Sep 28 2020, 1:39 AM.

Details

Summary

Following on from D87757 "[SplitKit] Only copy live lanes", it is
possible to split a live range at a point when none of its subranges
are live. This patch handles that case by inserting an implicit def
of the superreg.

Patch by Quentin Colombet!

Diff Detail

Event Timeline

foad created this revision.Sep 28 2020, 1:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2020, 1:39 AM
foad requested review of this revision.Sep 28 2020, 1:39 AM
foad updated this revision to Diff 294627.EditedSep 28 2020, 1:47 AM

Fix typo in RUN line.

rampitec accepted this revision.Sep 28 2020, 10:06 AM

Look reasonable, thanks!

This revision is now accepted and ready to land.Sep 28 2020, 10:06 AM
qcolombet accepted this revision.Sep 28 2020, 10:08 AM

Hi @foad,

LGTM.
The test case could be more descriptive though, see my inline comment.

Cheers,
-Quentin

llvm/test/CodeGen/AMDGPU/splitkit-nolivesubranges.mir
4

Could you add a comment on the characteristic of the test?
For instance, "This test aims at triggering a live-range splitting in a place when %0 subranges are all dead, but the main live-range of %0 is still alive. %0 main range is kept alive simply by not using undef. Then, the splitting is triggered by creating two points of high register pressure:

  1. One where %0 main range in the only live live-range: This will force the insertion of a split for %0 main range
  2. One where %0.subrange is live, so that the interference check in regalloc trigger the splitting heuristic"
This revision was automatically updated to reflect the committed changes.