summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/InstSelectSimple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/InstSelectSimple.cpp')
-rw-r--r--llvm/lib/Target/X86/InstSelectSimple.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp
index 2675a04ccf7..4ebffeb81be 100644
--- a/llvm/lib/Target/X86/InstSelectSimple.cpp
+++ b/llvm/lib/Target/X86/InstSelectSimple.cpp
@@ -679,7 +679,6 @@ static bool RequiresFPRegKill(const BasicBlock *BB) {
//
void ISel::InsertFPRegKills() {
SSARegMap &RegMap = *F->getSSARegMap();
- const TargetInstrInfo &TII = TM.getInstrInfo();
for (MachineFunction::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I!=E; ++I)
@@ -709,11 +708,7 @@ void ISel::InsertFPRegKills() {
// it's not an unwind/return), insert the FP_REG_KILL instruction.
if (BB->getBasicBlock()->getTerminator()->getNumSuccessors() &&
RequiresFPRegKill(BB->getBasicBlock())) {
- // Rewind past any terminator instructions that might exist.
- MachineBasicBlock::iterator I = BB->end();
- while (I != BB->begin() && TII.isTerminatorInstr((--I)->getOpcode()));
- if (I != BB->end()) ++I;
- BMI(BB, I, X86::FP_REG_KILL, 0);
+ BMI(BB, BB->getFirstTerminator(), X86::FP_REG_KILL, 0);
++NumFPKill;
}
}
OpenPOWER on IntegriCloud