llvm-6502/test
Chandler Carruth a403ceb205 [LPM] Fix PR18643, another scary place where loop transforms failed to
preserve loop simplify of enclosing loops.

The problem here starts with LoopRotation which ends up cloning code out
of the latch into the new preheader it is buidling. This can create
a new edge from the preheader into the exit block of the loop which
breaks LoopSimplify form. The code tries to fix this by splitting the
critical edge between the latch and the exit block to get a new exit
block that only the latch dominates. This sadly isn't sufficient.

The exit block may be an exit block for multiple nested loops. When we
clone an edge from the latch of the inner loop to the new preheader
being built in the outer loop, we create an exiting edge from the outer
loop to this exit block. Despite breaking the LoopSimplify form for the
inner loop, this is fine for the outer loop. However, when we split the
edge from the inner loop to the exit block, we create a new block which
is in neither the inner nor outer loop as the new exit block. This is
a predecessor to the old exit block, and so the split itself takes the
outer loop out of LoopSimplify form. We need to split every edge
entering the exit block from inside a loop nested more deeply than the
exit block in order to preserve all of the loop simplify constraints.

Once we try to do that, a problem with splitting critical edges
surfaces. Previously, we tried a very brute force to update LoopSimplify
form by re-computing it for all exit blocks. We don't need to do this,
and doing this much will sometimes but not always overlap with the
LoopRotate bug fix. Instead, the code needs to specifically handle the
cases which can start to violate LoopSimplify -- they aren't that
common. We need to see if the destination of the split edge was a loop
exit block in simplified form for the loop of the source of the edge.
For this to be true, all the predecessors need to be in the exact same
loop as the source of the edge being split. If the dest block was
originally in this form, we have to split all of the deges back into
this loop to recover it. The old mechanism of doing this was
conservatively correct because at least *one* of the exiting blocks it
rewrote was the DestBB and so the DestBB's predecessors were fixed. But
this is a much more targeted way of doing it. Making it targeted is
important, because ballooning the set of edges touched prevents
LoopRotate from being able to split edges *it* needs to split to
preserve loop simplify in a coherent way -- the critical edge splitting
would sometimes find the other edges in need of splitting but not
others.

Many, *many* thanks for help from Nick reducing these test cases
mightily. And helping lots with the analysis here as this one was quite
tricky to track down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29 13:16:53 +00:00
..
Analysis Fix crasher introduced in r200203 and caught by a libc++ buildbot. Don't assume that getMulExpr returns a SCEVMulExpr, it may have simplified it to something else! 2014-01-27 10:47:44 +00:00
Assembler Bug 18228 - Fix accepting bitcasts between vectors of pointers with a 2014-01-22 19:21:33 +00:00
Bindings Fix known typos 2014-01-24 17:20:08 +00:00
Bitcode Report a warning when dropping outdated debug info metadata. 2014-01-16 01:51:12 +00:00
BugPoint Debug Info: update testing cases to specify the debug info version number. 2013-11-23 01:16:29 +00:00
CodeGen Enable EHABI by default 2014-01-29 11:50:56 +00:00
DebugInfo Revert r200340, "Add line table debug info to COFF files when using a win32 triple." 2014-01-29 06:05:38 +00:00
ExecutionEngine Enable EHABI by default 2014-01-29 11:50:56 +00:00
Feature Debug Info: update testing cases to specify the debug info version number. 2013-11-23 01:16:29 +00:00
FileCheck FileCheck: fix a bug with multiple --check-prefix options. Similar to r194565 2013-11-20 13:25:05 +00:00
Instrumentation [asan] simplify a test 2014-01-29 07:35:43 +00:00
Integer
JitListener Debug Info: update testing cases to specify the debug info version number. 2013-11-22 21:49:45 +00:00
Linker Verify that attributes are not lost during linking. 2014-01-24 19:20:15 +00:00
LTO Provide a dummy section to fix a crash with inline assembly in LTO. 2014-01-22 22:11:14 +00:00
MC Enable EHABI by default 2014-01-29 11:50:56 +00:00
Object We do use pipefail these days. Update the test. 2014-01-29 04:08:05 +00:00
Other [PM] Wire up the Verifier for the new pass manager and connect it to the 2014-01-20 11:34:08 +00:00
TableGen [TableGen] Correctly generate implicit anonymous prototype defs in multiclasses 2014-01-02 20:47:09 +00:00
tools Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA. 2014-01-27 04:22:24 +00:00
Transforms [LPM] Fix PR18643, another scary place where loop transforms failed to 2014-01-29 13:16:53 +00:00
Unit
Verifier [PM] Make the verifier work independently of any pass manager. 2014-01-19 02:22:18 +00:00
YAMLParser
.clang-format Add .clang-format without column limit to subdirectory tests/. 2013-11-19 04:26:05 +00:00
CMakeLists.txt [CMake] Add llvm-tblgen to dependencies of check-llvm. 2014-01-18 19:01:08 +00:00
lit.cfg Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
lit.site.cfg.in Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
Makefile Eliminate inappropriate use of FindProgramByName() from lli 2014-01-22 21:52:35 +00:00
Makefile.tests
TestRunner.sh