diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-03-13 17:42:48 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-03-13 17:42:48 +0000 |
commit | c438f35df99989ac1d1e80236d72f22ea5ec6a8c (patch) | |
tree | 85c7b0789117f2f432531669f83b13f1d80e0f5f /lib/CodeGen | |
parent | a13341737da29f4dda4eceb8f03e7ff4b09f6e44 (diff) |
Undo tweak. It had no obvious benefit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 12e7d6a697..2713771ceb 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -687,25 +687,10 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) // All registers must have inf weight. Just grab one! if (!minReg) { - if (BestPhysReg) - minReg = BestPhysReg; - else { - // Get the physical register with the fewest conflicts. - unsigned MinConflicts = ~0U; - for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_), - e = RC->allocation_order_end(*mf_); i != e; ++i) { - unsigned reg = *i; - unsigned NumConflicts = li_->getNumConflictsWithPhysReg(*cur, reg); - if (NumConflicts <= MinConflicts) { - MinConflicts = NumConflicts; - minReg = reg; - } - } - } - - if (cur->weight == HUGE_VALF || cur->getSize() == 1) - // Spill a physical register around defs and uses. - li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_); + minReg = BestPhysReg ? BestPhysReg : *RC->allocation_order_begin(*mf_); + if (cur->weight == HUGE_VALF || cur->getSize() == 1) + // Spill a physical register around defs and uses. + li_->spillPhysRegAroundRegDefsUses(*cur, minReg, *vrm_); } } |