1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Another coalescer bug. When a dead copy is eliminated, transfer the kill to a def of the exact register rather than a super-register.

llvm-svn: 78376
This commit is contained in:
Evan Cheng 2009-08-07 07:14:14 +00:00
parent 5af3c8154b
commit a565450757
2 changed files with 22 additions and 5 deletions

View File

@ -888,12 +888,13 @@ static void PropagateDeadness(LiveInterval &li, MachineInstr *CopyMI,
MachineInstr *DefMI =
li_->getInstructionFromIndex(li_->getDefIndex(LRStart));
if (DefMI && DefMI != CopyMI) {
int DeadIdx = DefMI->findRegisterDefOperandIdx(li.reg, false, tri_);
if (DeadIdx != -1) {
int DeadIdx = DefMI->findRegisterDefOperandIdx(li.reg, false);
if (DeadIdx != -1)
DefMI->getOperand(DeadIdx).setIsDead();
// A dead def should have a single cycle interval.
++LRStart;
}
else
DefMI->addOperand(MachineOperand::CreateReg(li.reg,
true, true, false, true));
++LRStart;
}
}

View File

@ -0,0 +1,16 @@
; RUN: llvm-as < %s | llc -mtriple=armv7-eabi -mattr=+vfp2
; PR4686
%a = type { i32 (...)** }
%b = type { %a }
%c = type { float, float, float, float }
declare arm_aapcs_vfpcc float @bar(%c*)
define arm_aapcs_vfpcc void @foo(%b* %x, %c* %y) {
entry:
%0 = call arm_aapcs_vfpcc float @bar(%c* %y) ; <float> [#uses=0]
%1 = fadd float undef, undef ; <float> [#uses=1]
store float %1, float* undef, align 8
ret void
}