From 9390cd0e86cb3b79f6836acab2a27b275e5bde9e Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Sat, 8 Aug 2009 13:19:10 +0000 Subject: Remove RegisterScavenger::isSuperRegUsed(). This completely reverses the mistaken commit r77904. Now there is no special treatment of instructions that redefine part of a super-register. Instead, the super-register is marked with and . For instance, from LowerSubregs on ARM: subreg: CONVERTING: %Q1 = INSERT_SUBREG %Q1, %D1, 5 subreg: %D2 = FCPYD %D1, 14, %reg0, %Q1 subreg: CONVERTING: %Q1 = INSERT_SUBREG %Q1, %D0, 6 subreg: %D3 = FCPYD %D0, 14, %reg0, %Q1, %Q1 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78466 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/LowerSubregs.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/LowerSubregs.cpp') diff --git a/lib/CodeGen/LowerSubregs.cpp b/lib/CodeGen/LowerSubregs.cpp index 6c5052a..f34b290 100644 --- a/lib/CodeGen/LowerSubregs.cpp +++ b/lib/CodeGen/LowerSubregs.cpp @@ -270,14 +270,15 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) { MachineBasicBlock::iterator CopyMI = MI; --CopyMI; + // INSERT_SUBREG is a two-address instruction so it implicitly kills SrcReg. + if (!MI->getOperand(1).isUndef()) + CopyMI->addOperand(MachineOperand::CreateReg(DstReg, false, true, true)); + // Transfer the kill/dead flags, if needed. if (MI->getOperand(0).isDead()) { TransferDeadFlag(MI, DstSubReg, TRI); - // Also add a SrcReg of the super register. - CopyMI->addOperand(MachineOperand::CreateReg(DstReg, false, true, true)); - } else if (MI->getOperand(1).isUndef()) { - // If SrcReg was marked we must make sure it is alive after this - // replacement. Add a SrcReg operand. + } else { + // Make sure the full DstReg is live after this replacement. CopyMI->addOperand(MachineOperand::CreateReg(DstReg, true, true)); } @@ -293,7 +294,7 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) { DOUT << "\n"; MBB->erase(MI); - return true; + return true; } /// runOnMachineFunction - Reduce subregister inserts and extracts to register -- cgit v1.1