diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:22:29 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-06 09:22:29 +0000 | 
| commit | f5a3459adfde823bc7617f8ecfdd9fbc5a1ffadf (patch) | |
| tree | 542734eaa7870f95912cbaebccb87dbec0c20b4f /lib/CodeGen/MachineSink.cpp | |
| parent | 67a71b3184ce20a901e874d0ee25e01397dd87ef (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/MachineSink.cpp')
| -rw-r--r-- | lib/CodeGen/MachineSink.cpp | 14 | 
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp index 9ba7d1486e0a..e47ba7c2cc37 100644 --- a/lib/CodeGen/MachineSink.cpp +++ b/lib/CodeGen/MachineSink.cpp @@ -72,8 +72,13 @@ bool MachineSinking::AllUsesDominatedByBlock(unsigned Reg,                                               MachineBasicBlock *MBB) const {    assert(TargetRegisterInfo::isVirtualRegister(Reg) &&           "Only makes sense for vregs"); -  for (MachineRegisterInfo::use_iterator I = RegInfo->use_begin(Reg), -       E = RegInfo->use_end(); I != E; ++I) { +  // Ignoring debug uses is necessary so debug info doesn't affect the code. +  // This may leave a referencing dbg_value in the original block, before +  // the definition of the vreg.  Dwarf generator handles this although the +  // user might not get the right info at runtime. +  for (MachineRegisterInfo::use_nodbg_iterator I =  +       RegInfo->use_nodbg_begin(Reg), +       E = RegInfo->use_nodbg_end(); I != E; ++I) {      // Determine the block of the use.      MachineInstr *UseInst = &*I;      MachineBasicBlock *UseBlock = UseInst->getParent(); @@ -135,7 +140,10 @@ bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) {      ProcessedBegin = I == MBB.begin();      if (!ProcessedBegin)        --I; -     + +    if (MI->isDebugValue()) +      continue; +      if (SinkInstruction(MI, SawStore))        ++NumSunk, MadeChange = true;  | 
