1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/include/llvm/Transforms
Philip Reames 1dd6ac3c67 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

llvm-svn: 238071
2015-05-22 23:53:24 +00:00
..
InstCombine Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
IPO libLTO, llvm-lto, gold: Introduce flag for controlling optimization level. 2015-03-19 22:01:00 +00:00
Scalar [PM] Clean up a stale comment that came from a differnt pass when 2015-02-01 11:35:56 +00:00
Utils Extend EarlyCSE to handle basic cases from JumpThreading and CVP 2015-05-22 23:53:24 +00:00
Instrumentation.h Delete unused createSanitizerCoverageModulePass overload. 2015-05-07 22:46:06 +00:00
IPO.h Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
ObjCARC.h Reformat linefeeds. 2014-05-26 00:25:26 +00:00
Scalar.h Add a speculative execution pass 2015-05-15 17:54:48 +00:00
Vectorize.h Allow vectorization of bit intrinsics in BB Vectorizer. 2014-04-25 03:33:48 +00:00