From 0ef76cadbbca29f7b9271336a335d5915cf07e7a Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 21 Dec 2003 16:47:43 +0000 Subject: [PATCH] Move FP_REG_KILL closer to the return instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10567 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/InstSelectSimple.cpp | 3 ++- lib/Target/X86/X86ISelSimple.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index fac58cc00ff..b2b15c5b940 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -834,8 +834,8 @@ void ISel::promote32(unsigned targetReg, const ValueRecord &VR) { /// ret float/double : Top of FP stack /// void ISel::visitReturnInst(ReturnInst &I) { - BuildMI(BB, X86::FP_REG_KILL, 0); if (I.getNumOperands() == 0) { + BuildMI(BB, X86::FP_REG_KILL, 0); BuildMI(BB, X86::RET, 0); // Just emit a 'ret' instruction return; } @@ -866,6 +866,7 @@ void ISel::visitReturnInst(ReturnInst &I) { visitInstruction(I); } // Emit a 'ret' instruction + BuildMI(BB, X86::FP_REG_KILL, 0); BuildMI(BB, X86::RET, 0); } diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index fac58cc00ff..b2b15c5b940 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -834,8 +834,8 @@ void ISel::promote32(unsigned targetReg, const ValueRecord &VR) { /// ret float/double : Top of FP stack /// void ISel::visitReturnInst(ReturnInst &I) { - BuildMI(BB, X86::FP_REG_KILL, 0); if (I.getNumOperands() == 0) { + BuildMI(BB, X86::FP_REG_KILL, 0); BuildMI(BB, X86::RET, 0); // Just emit a 'ret' instruction return; } @@ -866,6 +866,7 @@ void ISel::visitReturnInst(ReturnInst &I) { visitInstruction(I); } // Emit a 'ret' instruction + BuildMI(BB, X86::FP_REG_KILL, 0); BuildMI(BB, X86::RET, 0); }