Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 17 Jun 2013 19:00:36 +0000 (19:00 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 17 Jun 2013 19:00:36 +0000 (19:00 +0000)
commit4eed756153b84c211114a3e9186bf0cb55d4b394
tree75638704a4f7d8af5710e5ab6fb7ace3ba9ed921
parenta8a04380c597e1cdb8d635abd9e2669eab401545
Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.

The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.

This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.

This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8
19 files changed:
include/llvm/CodeGen/CalcSpillWeights.h
include/llvm/CodeGen/LiveIntervalAnalysis.h
include/llvm/CodeGen/LiveRangeEdit.h
include/llvm/CodeGen/RegAllocPBQP.h
lib/CodeGen/CalcSpillWeights.cpp
lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/LiveIntervalAnalysis.cpp
lib/CodeGen/LiveRangeEdit.cpp
lib/CodeGen/RegAllocBasic.cpp
lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/RegAllocPBQP.cpp
lib/CodeGen/SpillPlacement.cpp
lib/CodeGen/SplitKit.cpp
lib/CodeGen/SplitKit.h
lib/CodeGen/StackSlotColoring.cpp
test/CodeGen/ARM/lsr-unfolded-offset.ll
test/CodeGen/SPARC/2011-01-19-DelaySlot.ll
test/CodeGen/X86/2012-02-20-MachineCPBug.ll [deleted file]
test/CodeGen/X86/atom-bypass-slow-division-64.ll