diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-04-26 23:14:24 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-04-26 23:14:24 +0000 |
commit | 3f192450151f4ed9eb656037193651781adf7d41 (patch) | |
tree | 95027b150ccd86a0c121a3f1e932196483d534bb /llvm/lib/CodeGen/MachineInstrBundle.cpp | |
parent | 053c2a6f25e48132d8f66bd73f3575da47cfde88 (diff) | |
download | bcm5719-llvm-3f192450151f4ed9eb656037193651781adf7d41.tar.gz bcm5719-llvm-3f192450151f4ed9eb656037193651781adf7d41.zip |
[MachineInstrBundle] Improvement the recognition of dead definitions.
Now, it is possible to know that partial definitions are dead definitions and
recognize that clobbered registers are also dead.
llvm-svn: 267621
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstrBundle.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp index 4619daf3014..725237b5644 100644 --- a/llvm/lib/CodeGen/MachineInstrBundle.cpp +++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp @@ -293,7 +293,7 @@ MachineOperandIteratorBase::PhysRegInfo MachineOperandIteratorBase::analyzePhysReg(unsigned Reg, const TargetRegisterInfo *TRI) { bool AllDefsDead = true; - PhysRegInfo PRI = {false, false, false, false, false, false, false}; + PhysRegInfo PRI = {false, false, false, false, false, false, false, false}; assert(TargetRegisterInfo::isPhysicalRegister(Reg) && "analyzePhysReg not given a physical register!"); @@ -332,8 +332,12 @@ MachineOperandIteratorBase::analyzePhysReg(unsigned Reg, } } - if (AllDefsDead && PRI.FullyDefined) - PRI.DeadDef = true; + if (AllDefsDead) { + if (PRI.FullyDefined || PRI.Clobbered) + PRI.DeadDef = true; + else + PRI.PartialDeadDef = true; + } return PRI; } |