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/Utils
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
..
ASanStackFrameLayout.h Fix known typos 2014-01-24 17:20:08 +00:00
BasicBlockUtils.h Teach SplitBlockPredecessors how to handle landingpad blocks. 2015-01-28 23:06:47 +00:00
BuildLibCalls.h DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
BypassSlowDivision.h
Cloning.h Extended support for native Windows C++ EH outlining 2015-03-11 23:22:06 +00:00
CmpInstAnalysis.h Whitespace. 2014-05-19 04:43:03 +00:00
CodeExtractor.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
CtorUtils.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
GlobalStatus.h
IntegerDivision.h Whitespace. 2014-05-19 04:43:03 +00:00
Local.h Extend EarlyCSE to handle basic cases from JumpThreading and CVP 2015-05-22 23:53:24 +00:00
LoopUtils.h Exploit dereferenceable_or_null attribute in LICM pass 2015-05-18 18:07:00 +00:00
ModuleUtils.h Implement createSanitizerCtor, common helper function for all sanitizers 2015-05-06 18:48:22 +00:00
PromoteMemToReg.h [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
SimplifyIndVar.h Reformat blank lines. 2014-05-19 04:43:26 +00:00
SimplifyLibCalls.h SimplifyLibCalls: Add basic optimization of memchr calls. 2015-03-21 15:36:21 +00:00
SSAUpdater.h Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&. 2015-05-13 01:12:16 +00:00
SSAUpdaterImpl.h [Modules] Make Support/Debug.h modular. This requires it to not change 2014-04-21 22:55:11 +00:00
SymbolRewriter.h Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
UnifyFunctionExitNodes.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
UnrollLoop.h [LoopUnrollRuntime] Avoid high-cost trip count computation. 2015-04-14 03:20:38 +00:00
ValueMapper.h Rename MapValue(Metadata*) to MapMetadata() 2014-12-19 06:06:18 +00:00
VectorUtils.h Re-sort #include lines using my handy dandy ./utils/sort_includes.py 2015-02-13 09:09:03 +00:00