mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-25 21:16:19 +00:00
Patch to fix PR337. Make sure to mark all aliased physical registers as used
when we see a read of a register. This is important in cases like: AL = ... AH = ... = AX The read of AX must make both the AL and AH defs live until the use. llvm-svn: 13444
This commit is contained in:
parent
35e874420b
commit
b37490a331
@ -126,6 +126,12 @@ void LiveVariables::HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB,
|
||||
void LiveVariables::HandlePhysRegUse(unsigned Reg, MachineInstr *MI) {
|
||||
PhysRegInfo[Reg] = MI;
|
||||
PhysRegUsed[Reg] = true;
|
||||
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
|
||||
unsigned Alias = *AliasSet; ++AliasSet) {
|
||||
PhysRegInfo[Alias] = MI;
|
||||
PhysRegUsed[Alias] = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
|
||||
@ -140,11 +146,10 @@ void LiveVariables::HandlePhysRegDef(unsigned Reg, MachineInstr *MI) {
|
||||
PhysRegUsed[Reg] = false;
|
||||
|
||||
for (const unsigned *AliasSet = RegInfo->getAliasSet(Reg);
|
||||
*AliasSet; ++AliasSet) {
|
||||
unsigned Alias = *AliasSet;
|
||||
unsigned Alias = *AliasSet; ++AliasSet) {
|
||||
if (MachineInstr *LastUse = PhysRegInfo[Alias]) {
|
||||
if (PhysRegUsed[Alias])
|
||||
RegistersKilled.insert(std::make_pair(LastUse, Alias));
|
||||
RegistersKilled.insert(std::make_pair(LastUse, Alias));
|
||||
else
|
||||
RegistersDead.insert(std::make_pair(LastUse, Alias));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user