llvm-6502/test/CodeGen
Richard Sandiford 9608ed1311 Fix overly pessimistic shortcut in post-RA MachineLICM
Post-RA LICM keeps three sets of registers: PhysRegDefs, PhysRegClobbers
and TermRegs.  When it sees a definition of R it adds all aliases of R
to the corresponding set, so that when it needs to test for membership
it only needs to test a single register, rather than worrying about
aliases there too.  E.g. the final candidate loop just has:

    unsigned Def = Candidates[i].Def;
    if (!PhysRegClobbers.test(Def) && ...) {

to test whether register Def is multiply defined.

However, there was also a shortcut in ProcessMI to make sure we didn't
add candidates if we already knew that they would fail the final test.
This shortcut was more pessimistic than the final one because it
checked whether _any alias_ of the defined register was multiply defined.
This is too conservative for targets that define register pairs.
E.g. on z, R0 and R1 are sometimes used as a pair, so there is a
128-bit register that aliases both R0 and R1.  If a loop used
R0 and R1 independently, and the definition of R0 came first,
we would be able to hoist the R0 assignment (because that used
the final test quoted above) but not the R1 assignment (because
that meant we had two definitions of the paired R0/R1 register
and would fail the shortcut in ProcessMI).

This patch just uses the same check for the ProcessMI shortcut as
we use in the final candidate loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-20 09:11:13 +00:00
..
AArch64 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
ARM ARM: implement some simple f64 materializations. 2013-08-20 08:57:11 +00:00
CPP [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Generic [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Hexagon [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Inputs Debug Info Verifier: verify SPs in llvm.dbg.sp. 2013-07-27 01:26:08 +00:00
Mips [mips][msa] Added and.v, bmnz.v, bmz.v, bsel.v, nor.v, or.v, xor.v 2013-08-20 08:38:21 +00:00
MSP430 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
NVPTX [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
PowerPC Don't form PPC CTR-based loops around a copysignl call 2013-08-19 23:35:24 +00:00
R600 R600: Expand vector FRINT ops 2013-08-16 23:51:33 +00:00
SPARC [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
SystemZ Fix overly pessimistic shortcut in post-RA MachineLICM 2013-08-20 09:11:13 +00:00
Thumb [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Thumb2 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
X86 Improve the widening of integral binary vector operations 2013-08-19 20:01:35 +00:00
XCore [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00