From 7b61337ce61bb0de43e15c1e31a808fb1bdb5269 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sat, 20 Dec 2003 17:28:15 +0000 Subject: [PATCH] Move FP_REG_KILL closer to the actual branch instruction. llvm-svn: 10563 --- lib/Target/X86/InstSelectSimple.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index ca65c446ea7..fac58cc00ff 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -883,11 +883,12 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) { /// void ISel::visitBranchInst(BranchInst &BI) { BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one - BuildMI(BB, X86::FP_REG_KILL, 0); if (!BI.isConditional()) { // Unconditional branch? - if (BI.getSuccessor(0) != NextBB) + if (BI.getSuccessor(0) != NextBB) { + BuildMI(BB, X86::FP_REG_KILL, 0); BuildMI(BB, X86::JMP, 1).addPCDisp(BI.getSuccessor(0)); + } return; } @@ -898,6 +899,7 @@ void ISel::visitBranchInst(BranchInst &BI) { // computed some other way... unsigned condReg = getReg(BI.getCondition()); BuildMI(BB, X86::CMPri8, 2).addReg(condReg).addZImm(0); + BuildMI(BB, X86::FP_REG_KILL, 0); if (BI.getSuccessor(1) == NextBB) { if (BI.getSuccessor(0) != NextBB) BuildMI(BB, X86::JNE, 1).addPCDisp(BI.getSuccessor(0)); @@ -936,6 +938,7 @@ void ISel::visitBranchInst(BranchInst &BI) { X86::JS, X86::JNS }, }; + BuildMI(BB, X86::FP_REG_KILL, 0); if (BI.getSuccessor(0) != NextBB) { BuildMI(BB, OpcodeTab[isSigned][OpNum], 1).addPCDisp(BI.getSuccessor(0)); if (BI.getSuccessor(1) != NextBB)