This is an archive of the discontinued LLVM Phabricator instance.

LiveIntervalAnalysis: Add function to reassign vregs of dead subregister defs
AbandonedPublic

Authored by MatzeB on Nov 24 2015, 1:50 PM.

Details

Reviewers
atrick
Summary

Normally dead definitions have an own vreg when coming out of SSA form.
However we do not have a static single assignment property at the
subregister level, so we cannot easily detect dead subregister
definitions without doing subregister liveness analysis. We also cannot
mark them with a dead flag unless all lanes (even the ones not
affected by the subregister definition) are dead.

The new LiveIntervalAnalysis::renameDeadSubRegDefs() detects dead
subregister definitions based on liveness information and assigns them
to new vreg.

This is intended as a prepass to subregister aware scheduling and avoids
the formation of multiple connected components in liveintervals if dead
subregister defs are moved. It may also have some positive effects on
the allocation by removing unnecessary constraints.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 41080.Nov 24 2015, 1:50 PM
MatzeB retitled this revision from to LiveIntervalAnalysis: Add function to reassign vregs of dead subregister defs.
MatzeB updated this object.
MatzeB added a reviewer: atrick.
MatzeB set the repository for this revision to rL LLVM.
arsenm added inline comments.Nov 25 2015, 6:19 AM
lib/CodeGen/LiveIntervalAnalysis.cpp
1489

grammar, s/an/their/

atrick requested changes to this revision.Nov 29 2015, 10:27 PM
atrick edited edge metadata.

LGTM except for the inline comments.

lib/CodeGen/LiveIntervalAnalysis.cpp
1481

This function needs comments reflecting some of what is explained in the commit message. It should be clear that this is an optimization not required for correctness.

1498

This shadows 'Reg' above. It should probably be an assert.

1528

setIsUndef confused me at first. You must be assuming here that this is a subregister def and that subreg defs are always marked undef. Please comment. Also let me know where that invariant is explained and enforced.

This revision now requires changes to proceed.Nov 29 2015, 10:27 PM
MatzeB abandoned this revision.Jan 12 2016, 2:42 PM

This is superseded by http://reviews.llvm.org/D16126 as it turned out the dead subregister defs are just a special case of a general situation where subregisters defs+uses do not influence each other and can be split into separate equivalence classes.