1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib
Quentin Colombet a09cf4d3ee [MachineSink] Improve the compile time by preserving the dominance information
as long as possible.

** Context **

Each time the dominance information is modified, the dominator tree analysis
switches in a slow query mode. After a few queries without any modification on
the dominator tree, it performs an expensive update of its internal structure to
provide fast queries again.

** Problem **

Prior to this patch, the MachineSink pass was splitting the critical edges on
demand while relying heavy on the dominator tree information. In some cases,
this leads to pathological behavior where:
- We end up in the slow query mode right after splitting an edge.
- We update the dominance information.
- We break the dominance information again, thus ending up in the slow query
  mode and so on.

** Proposed Solution **

To mitigate this effect, this patch postpones all the splitting of the edges at
the end of each iteration of the main loop.
The benefits are:
- The dominance information is valid for the life time of an iteration.
- This simplifies the code as we do not have to special treat instructions that
  are sunk on critical edges. Indeed, the related block will be available
  through the next iteration.

The downside is that when edges splitting is required, this incurs an additional
iteration of the main loop compared to the previous scheme.

** Performance **

Thanks to this patch, the motivating example compiles in 6+ minutes instead of
10+ minutes. No test case added as the motivating example as nothing special but
being huge!

I have measured only noise for both the compile time and the runtime on the llvm
test-suite + SPECs with Os and O3.

Note: The current implementation of MachineBasicBlock::SplitCriticalEdge also
uses the dominance information and therefore, hits this problem. A subsequent
patch will address that.

<rdar://problem/17894619>

llvm-svn: 215410
2014-08-11 23:52:01 +00:00
..
Analysis In LVI(Lazy Value Info), originally value on a BB can only be caculated once, 2014-08-11 05:02:04 +00:00
AsmParser Remove dead code in condition 2014-08-05 18:22:58 +00:00
Bitcode BitcodeReader: Fix non-determinism in use-list order 2014-08-05 17:49:48 +00:00
CodeGen [MachineSink] Improve the compile time by preserving the dominance information 2014-08-11 23:52:01 +00:00
DebugInfo DWOHolder takes ownership of the argument constructor, use std::unique_ptr. 2014-07-31 20:26:42 +00:00
ExecutionEngine [MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy. 2014-08-08 23:12:22 +00:00
IR Fix typos: 2014-08-11 18:04:46 +00:00
IRReader Update the MemoryBuffer API to use ErrorOr. 2014-07-06 17:43:13 +00:00
LineEditor
Linker Fix use of uninitialized variable. 2014-08-11 17:07:34 +00:00
LTO Don't internalize all but main by default. 2014-08-05 20:10:38 +00:00
MC MC: Diagnose an unexpected token in COFF .section instead of asserting 2014-08-11 18:34:43 +00:00
Object AArch64: add support for dynamic-loader relocations 2014-08-11 10:10:27 +00:00
Option Generic: add range-adapter for option parsing. 2014-07-09 13:03:37 +00:00
ProfileData Coverage: add HasCodeBefore flag to a mapping region. 2014-08-04 18:00:51 +00:00
Support ADT: remove MinGW32 and Cygwin OSType enum 2014-08-09 23:12:20 +00:00
TableGen [tablegen] - Eliminate memory leaks in TGParser.cpp 2014-08-08 00:29:54 +00:00
Target R600/SIInstrInfo.cpp: Suppress an warning. [-Wunused-variable] 2014-08-11 23:03:38 +00:00
Transforms InstCombine: Combine (add (and %a, %b) (or %a, %b)) to (add %a, %b) 2014-08-11 22:32:02 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile