[llvm-commits] [llvm] r104326 - /llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp
Chris Lattner
sabre at nondot.org
Fri May 21 10:49:07 PDT 2010
Author: lattner
Date: Fri May 21 12:49:07 2010
New Revision: 104326
URL: http://llvm.org/viewvc/llvm-project?rev=104326&view=rev
Log:
modernize this pass a bit, fit in 80 columns.
Modified:
llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp
Modified: llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp?rev=104326&r1=104325&r2=104326&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FloatingPointRegKill.cpp Fri May 21 12:49:07 2010
@@ -42,12 +42,16 @@
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 @@
// 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<PHINode>(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;
}
More information about the llvm-commits
mailing list