[llvm-commits] [llvm] r48341 - /llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Evan Cheng
evan.cheng at apple.com
Thu Mar 13 10:42:49 PDT 2008
Author: evancheng
Date: Thu Mar 13 12:42:48 2008
New Revision: 48341
URL: http://llvm.org/viewvc/llvm-project?rev=48341&view=rev
Log:
Undo tweak. It had no obvious benefit.
Modified:
llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
Modified: llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp?rev=48341&r1=48340&r2=48341&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp Thu Mar 13 12:42:48 2008
@@ -687,25 +687,10 @@
// 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_);
}
}
More information about the llvm-commits
mailing list