diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-10-14 23:39:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-10-14 23:39:27 +0000 |
commit | d94b8ee12edef4928c7fc762e3c8a4bf7075bdd8 (patch) | |
tree | 275e56c43e7e4897ef60e324fda4ef9f4dc8a32b /lib/CodeGen/LiveVariables.cpp | |
parent | b71c46ced3b6452d2d96e06b5fde59910541ccb5 (diff) | |
download | external_llvm-d94b8ee12edef4928c7fc762e3c8a4bf7075bdd8.zip external_llvm-d94b8ee12edef4928c7fc762e3c8a4bf7075bdd8.tar.gz external_llvm-d94b8ee12edef4928c7fc762e3c8a4bf7075bdd8.tar.bz2 |
When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 139e029..96c655c 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -323,10 +323,21 @@ bool LiveVariables::HandlePhysRegKill(unsigned Reg, MachineInstr *MI) { // The last partial def kills the register. LastPartDef->addOperand(MachineOperand::CreateReg(Reg, false/*IsDef*/, true/*IsImp*/, true/*IsKill*/)); - else + else { + MachineOperand *MO = + LastRefOrPartRef->findRegisterDefOperand(Reg, false, TRI); + bool NeedEC = MO->isEarlyClobber() && MO->getReg() != Reg; // If the last reference is the last def, then it's not used at all. // That is, unless we are currently processing the last reference itself. LastRefOrPartRef->addRegisterDead(Reg, TRI, true); + if (NeedEC) { + // If we are adding a subreg def and the superreg def is marked early + // clobber, add an early clobber marker to the subreg def. + MO = LastRefOrPartRef->findRegisterDefOperand(Reg); + if (MO) + MO->setIsEarlyClobber(); + } + } } else if (!PhysRegUse[Reg]) { // Partial uses. Mark register def dead and add implicit def of // sub-registers which are used. |