From 3f192450151f4ed9eb656037193651781adf7d41 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Tue, 26 Apr 2016 23:14:24 +0000 Subject: [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 --- llvm/lib/CodeGen/MachineInstrBundle.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp') 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; } -- cgit v1.2.3