From 6f569aabb5b34e2db03eccf7acffbc6913228961 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 21 May 2010 17:49:07 +0000 Subject: [PATCH] modernize this pass a bit, fit in 80 columns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104326 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86FloatingPointRegKill.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Target/X86/X86FloatingPointRegKill.cpp b/lib/Target/X86/X86FloatingPointRegKill.cpp index 541083f6fff..14b4df8d8b5 100644 --- a/lib/Target/X86/X86FloatingPointRegKill.cpp +++ b/lib/Target/X86/X86FloatingPointRegKill.cpp @@ -42,12 +42,16 @@ namespace { virtual bool runOnMachineFunction(MachineFunction &MF); - virtual const char *getPassName() const { return "X86 FP_REG_KILL inserter"; } + virtual const char *getPassName() const { + return "X86 FP_REG_KILL inserter"; + } }; char FPRegKiller::ID = 0; } -FunctionPass *llvm::createX87FPRegKillInserterPass() { return new FPRegKiller(); } +FunctionPass *llvm::createX87FPRegKillInserterPass() { + return new FPRegKiller(); +} bool FPRegKiller::runOnMachineFunction(MachineFunction &MF) { // If we are emitting FP stack code, scan the basic block to determine if this @@ -112,15 +116,14 @@ bool FPRegKiller::runOnMachineFunction(MachineFunction &MF) { // Final check, check LLVM BB's that are successors to the LLVM BB // corresponding to BB for FP PHI nodes. const BasicBlock *LLVMBB = MBB->getBasicBlock(); - const PHINode *PN; for (succ_const_iterator SI = succ_begin(LLVMBB), E = succ_end(LLVMBB); !ContainsFPCode && SI != E; ++SI) { + const PHINode *PN; for (BasicBlock::const_iterator II = SI->begin(); (PN = dyn_cast(II)); ++II) { - if (PN->getType()==Type::getX86_FP80Ty(LLVMBB->getContext()) || + if (PN->getType()->isX86_FP80Ty() || (!Subtarget.hasSSE1() && PN->getType()->isFloatingPointTy()) || - (!Subtarget.hasSSE2() && - PN->getType()==Type::getDoubleTy(LLVMBB->getContext()))) { + (!Subtarget.hasSSE2() && PN->getType()->isDoubleTy())) { ContainsFPCode = true; break; } -- 2.34.1