Fix a bug in spill weight computation. If the alias is a super-register, and the...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 23 Mar 2009 22:57:19 +0000 (22:57 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 23 Mar 2009 22:57:19 +0000 (22:57 +0000)
commit5d088fee7cf20309669f85d2027e2b010b40025b
tree96a20521982cee8911e88a817d31561ef0d3ba72
parent13b9bf9022e4a9f217489273f6128457efd84d34
Fix a bug in spill weight computation. If the alias is a super-register, and the super-register is in the register class we are trying to allocate. Then add the weight to all sub-registers of the super-register even if they are not aliases.
e.g. allocating for GR32, bh is not used, updating bl spill weight.
     bl should get the same spill weight otherwise it will be choosen
     as a spill candidate since spilling bh doesn't make ebx available.
This fix PR2866.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67574 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegAllocLinearScan.cpp
test/CodeGen/X86/2009-03-23-LinearScanBug.ll [new file with mode: 0644]