llvm-6502/test
Chandler Carruth de1c9bb450 Remove return heuristics from the static branch probabilities, and
introduce no-return or unreachable heuristics.

The return heuristics from the Ball and Larus paper don't work well in
practice as they pessimize early return paths. The only good hitrate
return heuristics are those for:
 - NULL return
 - Constant return
 - negative integer return

Only the last of these three can possibly require significant code for
the returning block, and even the last is fairly rare and usually also
a constant. As a consequence, even for the cold return paths, there is
little code on that return path, and so little code density to be gained
by sinking it. The places where sinking these blocks is valuable (inner
loops) will already be weighted appropriately as the edge is a loop-exit
branch.

All of this aside, early returns are nearly as common as all three of
these return categories, and should actually be predicted as taken!
Rather than muddy the waters of the static predictions, just remain
silent on returns and let the CFG itself dictate any layout or other
issues.

However, the return heuristic was flagging one very important case:
unreachable. Unfortunately it still gave a 1/4 chance of the
branch-to-unreachable occuring. It also didn't do a rigorous job of
finding those blocks which post-dominate an unreachable block.

This patch builds a more powerful analysis that should flag all branches
to blocks known to then reach unreachable. It also has better worst-case
runtime complexity by not looping through successors for each block. The
previous code would perform an N^2 walk in the event of a single entry
block branching to N successors with a switch where each successor falls
through to the next and they finally fall through to a return.

Test case added for noreturn heuristics. Also doxygen comments improved
along the way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-24 12:01:08 +00:00
..
Analysis Remove return heuristics from the static branch probabilities, and 2011-10-24 12:01:08 +00:00
Archive
Assembler Fix a typo in the bitcode reader in the handling of atomic stores. Reported by David Meyer on llvmdev. 2011-09-19 19:41:28 +00:00
Bindings/Ocaml OCaml bindings: add some missing functions and testcases. 2011-10-14 20:38:33 +00:00
Bitcode
BugPoint
CodeGen Completely re-write the algorithm behind MachineBlockPlacement based on 2011-10-23 09:18:45 +00:00
DebugInfo Add a new wrapper node for a DILexicalBlock that encapsulates it and a 2011-10-11 22:59:11 +00:00
ExecutionEngine Excluding ARM JIT tests until someone can fix this compilation path. 2011-08-26 23:39:30 +00:00
Feature Update tests to the newest EH syntax. 2011-08-25 01:30:18 +00:00
Integer
lib s/tblgen/llvm-tblgen/g in a few missed places, including the tests 2011-10-06 13:39:59 +00:00
Linker Let this test pass even if 'int' is somewhere in its directory path. 2011-10-15 18:07:16 +00:00
MC Add X86 SARX, SHRX, and SHLX instructions. 2011-10-23 22:18:24 +00:00
Object llvm-objdump: Add static symbol table dumping. 2011-10-18 19:32:17 +00:00
Other Update to new EH scheme. 2011-08-31 21:44:24 +00:00
Scripts Fix the bitwidth of the remaining fields. 2011-08-04 17:00:11 +00:00
TableGen Add Paste Test 2011-10-19 13:04:50 +00:00
Transforms A dead malloc, a free(NULL) and a free(undef) are all trivially dead 2011-10-24 04:35:36 +00:00
Unit
Verifier
CMakeLists.txt test/CMakeLists.txt: Depend on llvm-objdump. "make check" is expected to resolve test-dependent targets on CMake build. 2011-09-27 21:54:50 +00:00
lit.cfg s/tblgen/llvm-tblgen/g in a few missed places, including the tests 2011-10-06 13:39:59 +00:00
lit.site.cfg.in
Makefile test/Makefile: Inspect $(PROJ_OBJ_ROOT)/tools/clang/Makefile instead of $(PROJ_SRC_ROOT)/tools/clang for "check-all". 2011-10-16 02:54:14 +00:00
Makefile.tests
site.exp.in
TestRunner.sh