This is an archive of the discontinued LLVM Phabricator instance.

LiveInterval: Add utility class to rename independent subregister usage
ClosedPublic

Authored by MatzeB on Jan 12 2016, 2:40 PM.

Details

Summary

This supersedes http://reviews.llvm.org/D14966

This renaming is necessary to avoid a subregister aware scheduler
accidentally creating liveness "holes" which are rejected by the
MachineVerifier.

Explanation as found in this patch:

Helper class that can divide MachineOperands of a virtual register into
equivalence classes of connected components.
MachineOperands belong to the same equivalence class when they are part of
the same SubRange segment or adjacent segments (adjacent in control
flow); Different subranges affected by the same MachineOperand belong to
the same equivalence class.

Example:

vreg0:sub0 = ...
vreg0:sub1 = ...
vreg0:sub2 = ...
...
xxx        = op vreg0:sub1
vreg0:sub1 = ...
store vreg0:sub0_sub1

The example contains 3 different equivalence classes:

  • One for the (dead) vreg0:sub2 definition
  • One containing the first vreg0:sub1 definition and its use, but not the second definition!
  • The remaining class contains all other operands involving vreg0.

We provide a utility function here to rename disjunct classes to different
virtual registers.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 44679.Jan 12 2016, 2:40 PM
MatzeB retitled this revision from to LiveInterval: Add utility class to rename independent subregister usage.
MatzeB updated this object.
MatzeB added a reviewer: atrick.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
atrick edited edge metadata.Jan 12 2016, 2:46 PM

splitSeparateSubRegComponents is a bit long. Would you consider encapsulating some of the loops into helpers?

MatzeB updated this revision to Diff 44704.Jan 12 2016, 7:35 PM
MatzeB edited edge metadata.
  • Renamed main function to "renameComponents()"
  • Split the implementation into several functions.
atrick accepted this revision.Jan 13 2016, 9:55 PM
atrick edited edge metadata.

Comment struct SubRangeInfo. e.g. Index is its position in the containing vector.

Otherwise... Awesome!

This revision is now accepted and ready to land.Jan 13 2016, 9:55 PM
This revision was automatically updated to reflect the committed changes.