llvm-6502/lib
Philip Reames e00c0df2c4 Extend EarlyCSE to handle basic cases from JumpThreading and CVP
This patch extends EarlyCSE to take advantage of the information that a controlling branch gives us about the value of a Value within this and dominated basic blocks. If the current block has a single predecessor with a controlling branch, we can infer what the branch condition must have been to execute this block. The actual change to support this is downright simple because EarlyCSE's existing scoped hash table logic deals with most of the complexity around merging.

The patch actually implements two optimizations.
1) The first is analogous to JumpThreading in that it enables EarlyCSE's CSE handling to fold branches which are exactly redundant due to a previous branch to branches on constants. (It doesn't actually replace the branch or change the CFG.) This is pretty clearly a win since it enables substantial CFG simplification before we start trying to inline.
2) The second is analogous to CVP in that it exploits the knowledge gained to replace dominated *uses* of the original value. EarlyCSE does not otherwise reason about specific uses, so this is the more arguable one. It does enable further simplication and constant folding within the rest of the visit by EarlyCSE.

In both cases, the added code only handles the easy dominance based case of each optimization. The general case is deferred to the existing passes.

Differential Revision: http://reviews.llvm.org/D9763



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238071 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-22 23:53:24 +00:00
..
Analysis [InstSimplify] Handle some overflow intrinsics in InstSimplify 2015-05-22 03:56:46 +00:00
AsmParser
Bitcode
CodeGen [AArch64][CGP] Sink zext feeding stxr/stlxr into the same block. 2015-05-22 21:37:17 +00:00
DebugInfo Make it easier to use DwarfContext with MCJIT 2015-05-21 21:24:32 +00:00
ExecutionEngine Reapply part of r237975, "Fix Clang -Wmissing-override warning", except for DIContext.h, to apease g++-4.7. 2015-05-22 10:11:07 +00:00
Fuzzer [lib/Fuzzer] remove -use_coverage_pairs=1, an experimental feature that is unlikely to ever scale 2015-05-22 22:47:03 +00:00
IR Use Op<0> accessor instead of OperandList for Instructions. NFC 2015-05-21 22:48:54 +00:00
IRReader
LineEditor
Linker
LTO
MC MC: Shave a pointer off of MCSymbol::Name 2015-05-22 06:04:42 +00:00
Object Stop inventing symbol sizes. 2015-05-22 15:43:00 +00:00
Option
Passes
ProfileData
Support Reinforce ARMTargetParser::getCanonicalArchName validation 2015-05-22 20:43:30 +00:00
TableGen
Target make reciprocal estimate code generation more flexible by adding command-line options 2015-05-22 21:10:06 +00:00
Transforms Extend EarlyCSE to handle basic cases from JumpThreading and CVP 2015-05-22 23:53:24 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile