forked from OSchip/llvm-project
Fix Regression/CodeGen/Generic/2006-09-02-LocalAllocCrash.ll on X86.
Just because an alias of a register is available, it doesn't mean that we can arbitrarily evict the register. llvm-svn: 30064
This commit is contained in:
parent
798e9658d7
commit
7cc20d418b
llvm/lib/CodeGen
|
@ -408,10 +408,15 @@ unsigned RA::getReg(MachineBasicBlock &MBB, MachineInstr *I,
|
|||
} else {
|
||||
// If one of the registers aliased to the current register is
|
||||
// compatible, use it.
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(R);
|
||||
*AliasSet; ++AliasSet) {
|
||||
if (RC->contains(*AliasSet)) {
|
||||
PhysReg = *AliasSet; // Take an aliased register
|
||||
for (const unsigned *AliasIt = RegInfo->getAliasSet(R);
|
||||
*AliasIt; ++AliasIt) {
|
||||
if (RC->contains(*AliasIt) &&
|
||||
// If this is pinned down for some reason, don't use it. For
|
||||
// example, if CL is pinned, and we run across CH, don't use
|
||||
// CH as justification for using scavenging ECX (which will
|
||||
// fail).
|
||||
PhysRegsUsed[*AliasIt] != 0) {
|
||||
PhysReg = *AliasIt; // Take an aliased register
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue