Add CoalescerPair helper class.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 Jun 2010 16:04:21 +0000 (16:04 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 15 Jun 2010 16:04:21 +0000 (16:04 +0000)
commit40d07bbebbe73914af28be1bdab169ce8333adca
treec1e7ca4b5aa99d285a603d8394c312a4762622fd
parentf4a7bf4ec3faf80a9c890408d574a3d2e7ed1e1e
Add CoalescerPair helper class.

Given a copy instruction, CoalescerPair can determine which registers to
coalesce in order to eliminate the copy. It deals with all the subreg fun to
determine a tuple (DstReg, SrcReg, SubIdx) such that:

- SrcReg is a virtual register that will disappear after coalescing.
- DstReg is a virtual or physical register whose live range will be extended.
- SubIdx is 0 when DstReg is a physical register.
- SrcReg can be joined with DstReg:SubIdx.

CoalescerPair::isCoalescable() determines if another copy instruction is
compatible with the same tuple. This fixes some NEON miscompilations where
shuffles are getting coalesced as if they were copies.

The CoalescerPair class will replace a lot of the spaghetti logic in JoinCopy
later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105997 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/RegisterCoalescer.h
lib/CodeGen/RegisterCoalescer.cpp
lib/CodeGen/SimpleRegisterCoalescing.cpp
lib/CodeGen/SimpleRegisterCoalescing.h
test/CodeGen/Thumb2/2010-06-14-NEONCoalescer.ll [new file with mode: 0644]