diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:50:39 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-05-04 20:50:39 +0000 | 
| commit | 59161dfae3225dd9151afbc76ca9074598c0c605 (patch) | |
| tree | 3c3ffb5df9fa6dfb2c48b807faf73dd2943db75d /lib/CodeGen/LiveIntervalAnalysis.cpp | |
| parent | d7f7719e5e082c0b8ea2182dcbd2242b7834aa26 (diff) | |
Notes
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
| -rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 26a7190110f94..ca9921cd3323e 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -262,6 +262,23 @@ static void printRegName(unsigned reg, const TargetRegisterInfo* tri_) {  }  #endif +static +bool MultipleDefsByMI(const MachineInstr &MI, unsigned MOIdx) { +  unsigned Reg = MI.getOperand(MOIdx).getReg(); +  for (unsigned i = MOIdx+1, e = MI.getNumOperands(); i < e; ++i) { +    const MachineOperand &MO = MI.getOperand(i); +    if (!MO.isReg()) +      continue; +    if (MO.getReg() == Reg && MO.isDef()) { +      assert(MI.getOperand(MOIdx).getSubReg() != MO.getSubReg() && +             MI.getOperand(MOIdx).getSubReg() && +             MO.getSubReg()); +      return true; +    } +  } +  return false; +} +  void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,                                               MachineBasicBlock::iterator mi,                                               SlotIndex MIIdx, @@ -372,6 +389,13 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,      }    } else { +    if (MultipleDefsByMI(*mi, MOIdx)) +      // Mutple defs of the same virtual register by the same instruction. e.g. +      // %reg1031:5<def>, %reg1031:6<def> = VLD1q16 %reg1024<kill>, ... +      // This is likely due to elimination of REG_SEQUENCE instructions. Return +      // here since there is nothing to do. +      return; +      // If this is the second time we see a virtual register definition, it      // must be due to phi elimination or two addr elimination.  If this is      // the result of two address elimination, then the vreg is one of the  | 
