diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-13 06:24:30 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-13 06:24:30 +0000 |
commit | 19b6486d3891c8a02a301aa1b44348a420772fcf (patch) | |
tree | 24d3df471babfce8ed1f740c12a0280b6fab0d9f /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 504e8fb74e4eec97a2ee1c195026824468cb6f7f (diff) |
Correctly compute live variable information for physical registers
when an implicitely defined register is later used by an alias. For example:
call foo
%reg1024 = mov %AL
The call implicitely defines EAX but only AL is used. Before this fix
no information was available on AL. Now EAX and all its aliases except
AL get defined and die at the call instruction whereas AL lives to be
killed by the assignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index fe47a3661d..f8c83f18ea 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -261,6 +261,8 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock* mbb, if (reg < MRegisterInfo::FirstVirtualRegister) { if (allocatableRegisters_[reg]) { handlePhysicalRegisterDef(mbb, mi, reg); + for (const unsigned* as = mri_->getAliasSet(reg); *as; ++as) + handlePhysicalRegisterDef(mbb, mi, *as); } } else { @@ -300,10 +302,8 @@ void LiveIntervals::computeIntervals() instr->print(std::cerr, *tm_);); // handle implicit defs - for (const unsigned* id = tid.ImplicitDefs; *id; ++id) { - unsigned physReg = *id; - handlePhysicalRegisterDef(mbb, mi, physReg); - } + for (const unsigned* id = tid.ImplicitDefs; *id; ++id) + handleRegisterDef(mbb, mi, *id); // handle explicit defs for (int i = instr->getNumOperands() - 1; i >= 0; --i) { @@ -312,14 +312,9 @@ void LiveIntervals::computeIntervals() if (!mop.isRegister()) continue; - unsigned reg = mop.getAllocatedRegNum(); // handle defs - build intervals - if (mop.isDef()) { - if (reg < MRegisterInfo::FirstVirtualRegister) - handlePhysicalRegisterDef(mbb, mi, reg); - else - handleVirtualRegisterDef(mbb, mi, reg); - } + if (mop.isDef()) + handleRegisterDef(mbb, mi, mop.getAllocatedRegNum()); } } } |