llvm-mirror/lib
Kyle Butt f6ea6695ce Codegen: Tail-duplicate during placement.
The tail duplication pass uses an assumed layout when making duplication
decisions. This is fine, but passes up duplication opportunities that
may arise when blocks are outlined. Because we want the updated CFG to
affect subsequent placement decisions, this change must occur during
placement.

In order to achieve this goal, TailDuplicationPass is split into a
utility class, TailDuplicator, and the pass itself. The pass delegates
nearly everything to the TailDuplicator object, except for looping over
the blocks in a function. This allows the same code to be used for tail
duplication in both places.

This change, in concert with outlining optional branches, allows
triangle shaped code to perform much better, esepecially when the
taken/untaken branches are correlated, as it creates a second spine when
the tests are small enough.

Issue from previous rollback fixed, and a new test was added for that
case as well. Issue was worklist/scheduling/taildup issue in layout.

Issue from 2nd rollback fixed, with 2 additional tests. Issue was
tail merging/loop info/tail-duplication causing issue with loops that share
a header block.

Issue with early tail-duplication of blocks that branch to a fallthrough
predecessor fixed with test case: tail-dup-branch-to-fallthrough.ll

Differential revision: https://reviews.llvm.org/D18226

llvm-svn: 283842
2016-10-11 01:20:33 +00:00
..
Analysis Rename isHotFunction/isColdFunction to isFunctionEntryHot/isFunctionEntryCold. (NFC) 2016-10-10 21:47:28 +00:00
AsmParser [AsmParser] Remove unused partial template specialization. 2016-09-22 22:02:59 +00:00
Bitcode ThinLTO: handles modules with empty summaries 2016-10-08 04:44:18 +00:00
CodeGen Codegen: Tail-duplicate during placement. 2016-10-11 01:20:33 +00:00
DebugInfo Revert r283824 and r283823: Define DbiStreamBuilder::addDbgStream to add stream. 2016-10-11 00:15:50 +00:00
Demangle Avoid using alignas and constexpr. 2016-09-06 20:36:24 +00:00
ExecutionEngine Use StringRef instead of raw pointer in ExecutionEngine 2016-10-01 06:22:04 +00:00
Fuzzer [libFuzzer] implement value profile for switch, increase the size of the PCs array, make sure we don't overflow it 2016-10-11 01:14:41 +00:00
IR Teach llvm::StripDebugInfo() about global variable !dbg attachments. 2016-10-10 17:53:33 +00:00
IRReader Remove autoconf support 2016-01-26 21:29:08 +00:00
LibDriver Object: Replace NewArchiveIterator with a simpler NewArchiveMember class. NFCI. 2016-06-29 22:27:42 +00:00
LineEditor Fix Clang-tidy modernize-deprecated-headers warnings in some files; other minor fixes. 2016-03-28 17:40:08 +00:00
Linker DebugInfo: New metadata representation for global variables. 2016-09-13 01:12:59 +00:00
LTO ThinLTO: don't perform incremental LTO on module without a hash 2016-10-08 04:44:23 +00:00
MC Revert r283690, "MC: Remove unused entities." 2016-10-10 22:49:37 +00:00
Object [Object] Fix a crash in Archive::child_iterator's default constructor. 2016-10-05 21:20:00 +00:00
ObjectYAML [macho2yaml] Don't write empty linkedit data 2016-08-17 21:46:04 +00:00
Option Generalize ArgList::AddAllArgs more 2016-09-29 19:47:58 +00:00
Passes Fix test after renaming -name-anon-functions pass to -name-anon-globals 2016-09-16 17:18:16 +00:00
ProfileData NFC Add const 2016-09-30 21:05:55 +00:00
Support [ARM]: Add Cortex-R52 target to LLVM 2016-10-07 12:06:40 +00:00
TableGen Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes. 2016-08-23 17:14:32 +00:00
Target [AArch64][InstructionSelector] Teach how to select FP load/store. 2016-10-11 00:21:14 +00:00
Transforms [InstCombine] Transform !range metadata to !nonnull when combining loads 2016-10-11 01:00:45 +00:00
CMakeLists.txt Try to fix a circular dependency in the modules build. 2016-09-06 20:16:19 +00:00
LLVMBuild.txt Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00