OSDN Git Service

Take into account the cost of local intervals when selecting split candidate.
authorMarina Yatsina <marina.yatsina@intel.com>
Wed, 31 Jan 2018 13:31:08 +0000 (13:31 +0000)
committerMarina Yatsina <marina.yatsina@intel.com>
Wed, 31 Jan 2018 13:31:08 +0000 (13:31 +0000)
commit1eecb87b7798041e1a4a8a669a5c762ee9b76465
tree548d3b7d4d72de0467dfb163390611be9d98539e
parentd69d8351ae618170ce9af3a694f53c79f8274ec3
Take into account the cost of local intervals when selecting split candidate.

When selecting a split candidate for region splitting, the register allocator tries to predict which candidate will have the cheapest spill cost.
Global splitting may cause the creation of local intervals, and they might spill.

This patch makes RA take into account the spill cost of local split intervals in use blocks (we already take into account the spill cost in through blocks).
A flag ("-condsider-local-interval-cost") controls weather we do this advanced cost calculation (it's on by default for X86 target, off for the rest).

Differential Revision: https://reviews.llvm.org/D41585

Change-Id: Icccb8ad2dbf13124f5d97a18c67d95aa6be0d14d

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323870 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/LiveRegMatrix.h
lib/CodeGen/LiveRegMatrix.cpp
lib/CodeGen/RegAllocGreedy.cpp
test/CodeGen/X86/bug26810.ll
test/CodeGen/X86/regalloc-advanced-split-cost.ll [new file with mode: 0644]
test/CodeGen/X86/sad.ll