diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-25 22:24:52 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-25 22:24:52 +0000 |
commit | 5edd45a76b5a701d526c704c25200f39e8d32fe2 (patch) | |
tree | 672353a9cc7f3465ab03391584d5a41abd572c21 /llvm/lib | |
parent | 43b118fc2cff03c6729c891f6020d55c216cb5c5 (diff) | |
download | bcm5719-llvm-5edd45a76b5a701d526c704c25200f39e8d32fe2.tar.gz bcm5719-llvm-5edd45a76b5a701d526c704c25200f39e8d32fe2.zip |
Simplify this code by using use_iterator instead of reg_iterator
and skipping the defs.
llvm-svn: 82811
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 7fb33c6e4ce..f975ad344ad 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -70,10 +70,8 @@ bool MachineSinking::AllUsesDominatedByBlock(unsigned Reg, MachineBasicBlock *MBB) const { assert(TargetRegisterInfo::isVirtualRegister(Reg) && "Only makes sense for vregs"); - for (MachineRegisterInfo::reg_iterator I = RegInfo->reg_begin(Reg), - E = RegInfo->reg_end(); I != E; ++I) { - if (I.getOperand().isDef()) continue; // ignore def. - + for (MachineRegisterInfo::use_iterator I = RegInfo->use_begin(Reg), + E = RegInfo->use_end(); I != E; ++I) { // Determine the block of the use. MachineInstr *UseInst = &*I; MachineBasicBlock *UseBlock = UseInst->getParent(); |