aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-17 17:18:59 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-05-17 17:18:59 +0000
commit9ef9cf930da64449cabc476e90b846db461e5764 (patch)
tree23be1c21e4b966b9fc1de6c09a3f480ffa5bec4e /lib/CodeGen/RegAllocFast.cpp
parent915fa2f0335d13ec3c2e9e048b5545259bad3fab (diff)
downloadexternal_llvm-9ef9cf930da64449cabc476e90b846db461e5764.zip
external_llvm-9ef9cf930da64449cabc476e90b846db461e5764.tar.gz
external_llvm-9ef9cf930da64449cabc476e90b846db461e5764.tar.bz2
Avoid allocating the same physreg to multiple virtregs in one instruction.
While that approach works wonders for register pressure, it tends to break everything. This should unbreak the arm-linux builder and fix a number of miscompilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index ea3fa61..a8d1e0d 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -471,6 +471,7 @@ void RAFast::allocVirtReg(MachineInstr *MI, LiveRegEntry &LRE, unsigned Hint) {
unsigned BestReg = 0, BestCost = spillImpossible;
for (TargetRegisterClass::iterator I = AOB; I != AOE; ++I) {
+ if (UsedInInstr.test(*I)) continue;
unsigned Cost = calcSpillCost(*I);
// Cost is 0 when all aliases are already disabled.
if (Cost == 0)