diff options
| author | Eric Christopher <echristo@apple.com> | 2011-06-30 01:20:03 +0000 | 
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2011-06-30 01:20:03 +0000 | 
| commit | f81292ba3ba69ede44bbdeba8eb69ea5a09d33a3 (patch) | |
| tree | c361d9ee269f9770441846e78eccc9463272b61f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
| parent | 16cde8ad36dc1631ab7f4509033cb7d78bbbcccc (diff) | |
| download | llvm-f81292ba3ba69ede44bbdeba8eb69ea5a09d33a3.zip llvm-f81292ba3ba69ede44bbdeba8eb69ea5a09d33a3.tar.gz llvm-f81292ba3ba69ede44bbdeba8eb69ea5a09d33a3.tar.bz2  | |
Remove getRegClassForInlineAsmConstraint and all dependencies.
Fixes rdar://9643582
llvm-svn: 134123
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 101 | 
1 files changed, 0 insertions, 101 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 3001206..ea59ca1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5428,55 +5428,6 @@ typedef SmallVector<SDISelAsmOperandInfo,16> SDISelAsmOperandInfoVector;  } // end anonymous namespace -/// isAllocatableRegister - If the specified register is safe to allocate, -/// i.e. it isn't a stack pointer or some other special register, return the -/// register class for the register.  Otherwise, return null. -static const TargetRegisterClass * -isAllocatableRegister(unsigned Reg, MachineFunction &MF, -                      const TargetLowering &TLI, -                      const TargetRegisterInfo *TRI) { -  EVT FoundVT = MVT::Other; -  const TargetRegisterClass *FoundRC = 0; -  for (TargetRegisterInfo::regclass_iterator RCI = TRI->regclass_begin(), -       E = TRI->regclass_end(); RCI != E; ++RCI) { -    EVT ThisVT = MVT::Other; - -    const TargetRegisterClass *RC = *RCI; -    if (!RC->isAllocatable()) -      continue; -    // If none of the value types for this register class are valid, we -    // can't use it.  For example, 64-bit reg classes on 32-bit targets. -    for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end(); -         I != E; ++I) { -      if (TLI.isTypeLegal(*I)) { -        // If we have already found this register in a different register class, -        // choose the one with the largest VT specified.  For example, on -        // PowerPC, we favor f64 register classes over f32. -        if (FoundVT == MVT::Other || FoundVT.bitsLT(*I)) { -          ThisVT = *I; -          break; -        } -      } -    } - -    if (ThisVT == MVT::Other) continue; - -    // NOTE: This isn't ideal.  In particular, this might allocate the -    // frame pointer in functions that need it (due to them not being taken -    // out of allocation, because a variable sized allocation hasn't been seen -    // yet).  This is a slight code pessimization, but should still work. -    ArrayRef<unsigned> RawOrder = RC->getRawAllocationOrder(MF); -    if (std::find(RawOrder.begin(), RawOrder.end(), Reg) != RawOrder.end()) { -      // We found a matching register class.  Keep looking at others in case -      // we find one with larger registers that this physreg is also in. -      FoundRC = RC; -      FoundVT = ThisVT; -      break; -    } -  } -  return FoundRC; -} -  /// GetRegistersForValue - Assign registers (virtual or physical) for the  /// specified operand.  We prefer to assign virtual registers, to allow the  /// register allocator to handle the assignment process.  However, if the asm @@ -5611,58 +5562,6 @@ static void GetRegistersForValue(SelectionDAG &DAG,      return;    } -  // This is a reference to a register class that doesn't directly correspond -  // to an LLVM register class.  Allocate NumRegs consecutive, available, -  // registers from the class. -  std::vector<unsigned> RegClassRegs -    = TLI.getRegClassForInlineAsmConstraint(OpInfo.ConstraintCode, -                                            OpInfo.ConstraintVT); - -  const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo(); -  BitVector Reserved = TRI->getReservedRegs(MF); -  unsigned NumAllocated = 0; -  for (unsigned i = 0, e = RegClassRegs.size(); i != e; ++i) { -    unsigned Reg = RegClassRegs[i]; -    // Filter out the reserved registers, but note that reserved registers are -    // not fully determined at this point. We may still decide we need a frame -    // pointer. -    if (Reserved.test(Reg)) -      continue; -    // See if this register is available. -    if ((isOutReg && OutputRegs.count(Reg)) ||   // Already used. -        (isInReg  && InputRegs.count(Reg))) {    // Already used. -      // Make sure we find consecutive registers. -      NumAllocated = 0; -      continue; -    } - -    // Check to see if this register is allocatable (i.e. don't give out the -    // stack pointer). -    const TargetRegisterClass *RC = isAllocatableRegister(Reg, MF, TLI, TRI); -    if (!RC) {        // Couldn't allocate this register. -      // Reset NumAllocated to make sure we return consecutive registers. -      NumAllocated = 0; -      continue; -    } - -    // Okay, this register is good, we can use it. -    ++NumAllocated; - -    // If we allocated enough consecutive registers, succeed. -    if (NumAllocated == NumRegs) { -      unsigned RegStart = (i-NumAllocated)+1; -      unsigned RegEnd   = i+1; -      // Mark all of the allocated registers used. -      for (unsigned i = RegStart; i != RegEnd; ++i) -        Regs.push_back(RegClassRegs[i]); - -      OpInfo.AssignedRegs = RegsForValue(Regs, *RC->vt_begin(), -                                         OpInfo.ConstraintVT); -      OpInfo.MarkAllocatedRegs(isOutReg, isInReg, OutputRegs, InputRegs, *TRI); -      return; -    } -  } -    // Otherwise, we couldn't allocate enough registers for this.  }  | 
