Add TRI::getCommonSuperRegClass().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 7 May 2012 19:14:58 +0000 (19:14 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 7 May 2012 19:14:58 +0000 (19:14 +0000)
commitfd87839a4888840ab5718fd116ab169ac04126af
tree753573b52cf749d258ce5ebbaee7ffea4e60c133
parent42726835e38dd1b41c587187ddd04f5c9276ff08
Add TRI::getCommonSuperRegClass().

This function is a generalization of getMatchingSuperRegClass() to the
symmetric case where both sides are using a sub-register index. It will
find a super-register class and sub-register indexes that make this
diagram commute:

                                   PreA
                       SuperRC  ---------->  RCA

                          |                   |
                          |                   |
                     PreB |                   | SubA
                          |                   |
                          |                   |
                          V                   V

                         RCB    ----------> SubRC
                                   SubB

This can be used to coalesce copies like:

  %vreg1:sub16 = COPY %vreg2:sub16; GR64:%vreg1, GR32: %vreg2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156317 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetRegisterInfo.h
lib/Target/TargetRegisterInfo.cpp