Go to file
Quentin Colombet a8cb36ea43 [LiveIntervalAnalysis] Speed up creation of live ranges for physical registers
by using a segment set.

The patch addresses a compile-time performance regression in the LiveIntervals
analysis pass (see http://llvm.org/bugs/show_bug.cgi?id=18580). This regression
is especially critical when compiling long functions. Our analysis had shown
that the most of time is taken for generation of live intervals for physical
registers. Insertions in the middle of the array of live ranges cause quadratic
algorithmic complexity, which is apparently the main reason for the slow-down. 

Overview of changes:
- The patch introduces an additional std::set<Segment>* member in LiveRange for
  storing segments in the phase of initial creation. The set is used if this
  member is not NULL, otherwise everything works the old way. 
- The set of operations on LiveRange used during initial creation (i.e. used by
  createDeadDefs and extendToUses) have been reimplemented to use the segment
  set if it is available.
- After a live range is created the contents of the set are flushed to the
  segment vector, because the set is not as efficient as the vector for the
  later uses of the live range. After the flushing, the set is deleted and
  cannot be used again.
- The set is only for live ranges computed in
  LiveIntervalAnalysis::computeLiveInRegUnits() and getRegUnit() but not in
  computeVirtRegs(), because I did not bring any performance benefits to
  computeVirtRegs() and for some examples even brought a slow down.

Patch by Vaidas Gasiunas <vaidas.gasiunas@sap.com>

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

llvm-svn: 228421
2015-02-06 18:42:41 +00:00
clang ASTUnit: Use range-based for loops. 2015-02-06 18:36:04 +00:00
clang-tools-extra [clang-tidy] Don't ignore default set of checks when a config file is found. 2015-02-05 14:50:17 +00:00
compiler-rt [compiler-rt] Make MaybeReexec properly process DYLD_INSERT_LIBRARIES when using non-absolute paths 2015-02-06 12:07:29 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Implement log10 2015-01-30 18:00:34 +00:00
libcxx Add __cxxabi_config.h to libcxxabi headers. 2015-02-05 23:56:33 +00:00
libcxxabi unwind: use -fno-rtti -fno-exceptions -funwind-tables 2015-02-06 17:47:57 +00:00
lld Revert "[Core] Update ContentPermissions" 2015-02-06 14:55:40 +00:00
lldb Add support for SBProcess::PutSTDIN to remote processes 2015-02-06 18:32:57 +00:00
llgo irgen: don't emit debug metadata for locals 2015-01-29 00:34:30 +00:00
llvm [LiveIntervalAnalysis] Speed up creation of live ranges for physical registers 2015-02-06 18:42:41 +00:00
openmp Pin the libiomp5.dll for the lifetime of application, Windows-specific 2015-01-29 17:18:20 +00:00
polly Build the isl files as PIC 2015-02-04 21:56:28 +00:00