llvm-6502/lib
Will Dietz e4b44c1617 MachineSink: Fix and tweak critical-edge breaking heuristic.
Per original comment, the intention of this loop
is to go ahead and break the critical edge
(in order to sink this instruction) if there's
reason to believe doing so might "unblock" the
sinking of additional instructions that define
registers used by this one.  The idea is that if
we have a few instructions to sink "together"
breaking the edge might be worthwhile.

This commit makes a few small changes
to help better realize this goal:

First, modify the loop to ignore registers
defined by this instruction.  We don't
sink definitions of physical registers,
and sinking an SSA definition isn't
going to unblock an upstream instruction.

Second, ignore uses of physical registers.
Instructions that define physical registers are
rejected for sinking, and so moving this one
won't enable moving any defining instructions.
As an added bonus, while virtual register
use-def chains are generally small due
to SSA goodness, iteration over the uses
and definitions (used by hasOneNonDBGUse)
for physical registers like EFLAGS
can be rather expensive in practice.
(This is the original reason for looking at this)

Finally, to keep things simple continue
to only consider this trick for registers that
have a single use (via hasOneNonDBGUse),
but to avoid spuriously breaking critical edges
only do so if the definition resides
in the same MBB and therefore this one directly
blocks it from being sunk as well.
If sinking them together is meant to be,
let the iterative nature of this pass
sink the definition into this block first.

Update tests to accomodate this change,
add new testcase where sinking avoids pipeline stalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192608 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-14 16:57:17 +00:00
..
Analysis Rename DataLayout variables TD -> DL 2013-10-03 19:50:01 +00:00
AsmParser Add a GlobalAlias::isValidLinkage to reduce code duplication. 2013-10-09 16:07:32 +00:00
Bitcode AutoUpgrade: upgrade from scalar TBAA format to struct-path aware TBAA format. 2013-09-28 00:22:27 +00:00
CodeGen MachineSink: Fix and tweak critical-edge breaking heuristic. 2013-10-14 16:57:17 +00:00
DebugInfo [DebugInfo] Further simplify DWARFDebugAranges public interface 2013-10-02 07:12:47 +00:00
ExecutionEngine Adding multiple object support to MCJIT EH frame handling 2013-10-11 21:25:48 +00:00
IR Debug Info: In DIBuilder, the context field of subprogram is updated to use 2013-10-10 18:40:01 +00:00
IRReader Add 'const' qualifiers to static const char* variables. 2013-07-16 01:17:10 +00:00
Linker Add missing #include's to cctype when using isdigit/alpha/etc. 2013-10-12 00:55:57 +00:00
LTO Add a MCTargetStreamer interface. 2013-10-08 13:08:17 +00:00
MC MC: Don't assume incoming StringRef's are null terminated. 2013-10-13 22:09:26 +00:00
Object Add missing #include's to cctype when using isdigit/alpha/etc. 2013-10-12 00:55:57 +00:00
Option Fix another mistake in r190442. 2013-09-10 23:22:56 +00:00
Support Windows: Fix a typo in an assert 2013-10-14 01:17:32 +00:00
TableGen Add an error check for a typo I accidentally made in a td file that caused an assert to fire. 2013-08-20 04:22:09 +00:00
Target [AArch64] Add support for NEON scalar integer compare instructions. 2013-10-14 14:37:20 +00:00
Transforms Remove lib/Transforms/Instrumentation/ProfilingUtils.* 2013-10-14 16:46:46 +00:00
CMakeLists.txt Move LTO support library to a component, allowing it to be tested 2013-09-24 23:52:22 +00:00
LLVMBuild.txt Move LTO support library to a component, allowing it to be tested 2013-09-24 23:52:22 +00:00
Makefile Move LTO support library to a component, allowing it to be tested 2013-09-24 23:52:22 +00:00