OSDN Git Service

Replace analyzeSiblingValues with new algorithm to fix its compile
authorWei Mi <wmi@google.com>
Mon, 4 Apr 2016 16:42:40 +0000 (16:42 +0000)
committerWei Mi <wmi@google.com>
Mon, 4 Apr 2016 16:42:40 +0000 (16:42 +0000)
commitd31cb9b5c5418045d1227a287ee6d31c64a27b7b
treefaf9ff0b94cf2361bc91f970507917ee568fd6f0
parent3b14df5ae48c58157274750bf8d723e07a4433dd
Replace analyzeSiblingValues with new algorithm to fix its compile
time issue. The patch is to solve PR17409 and its duplicates.

analyzeSiblingValues is a N x N complexity algorithm where N is
the number of siblings generated by reg splitting. Although it
causes siginificant compile time issue when N is large, it is also
important for performance since it removes redundent spills and
enables rematerialization.

To solve the compile time issue, the patch removes analyzeSiblingValues
and replaces it with lower cost alternatives containing two parts. The
first part creates a new spill hoisting method in postOptimization of
register allocation. It does spill hoisting at once after all the spills
are generated instead of inside every instance of selectOrSplit. The
second part queries the define expr of the original register for
rematerializaiton and keep it always available during register allocation
even if it is already dead. It deletes those dead instructions only in
postOptimization. With the two parts in the patch, it can remove
analyzeSiblingValues without sacrificing performance.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265309 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/CodeGen/LiveRangeEdit.h
lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/LiveRangeEdit.cpp
lib/CodeGen/RegAllocBase.cpp
lib/CodeGen/RegAllocBase.h
lib/CodeGen/RegAllocBasic.cpp
lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/RegAllocPBQP.cpp
lib/CodeGen/Spiller.h
lib/CodeGen/SplitKit.cpp
lib/CodeGen/SplitKit.h
test/CodeGen/AArch64/aarch64-deferred-spilling.ll [deleted file]
test/CodeGen/X86/fp128-compare.ll
test/CodeGen/X86/hoist-spill.ll [new file with mode: 0644]
test/CodeGen/X86/new-remat.ll [new file with mode: 0644]
test/CodeGen/X86/ragreedy-hoist-spill.ll