Reapply r185393.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)
commitc5454ff0465cc11974f8f499d697c2fe1ebcfcc1
tree29a5659625c22a008dd8f8f50e56d7f2c1ba034e
parent6ab5468637453ffc90fcc8036e40615c1e04b775
Reapply r185393.

Original commit message:

Remove floating point computations from SpillPlacement.cpp.

Patch by Benjamin Kramer!

Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.

The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.

This patch can cause the register allocator to make different spilling
decisions. The differences should be small.

llvm-svn: 186434
llvm/lib/CodeGen/SpillPlacement.cpp
llvm/lib/CodeGen/SpillPlacement.h