예제 #1
0
void LDVImpl::
renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx) {
  UserValue *UV = lookupVirtReg(OldReg);
  if (!UV)
    return;

  if (TargetRegisterInfo::isVirtualRegister(NewReg))
    mapVirtReg(NewReg, UV);
  virtRegToEqClass.erase(OldReg);

  do {
    UV->renameRegister(OldReg, NewReg, SubIdx, TRI);
    UV = UV->getNext();
  } while (UV);
}
예제 #2
0
UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset) {
  UserValue *&Leader = userVarMap[Var];
  if (Leader) {
    UserValue *UV = Leader->getLeader();
    Leader = UV;
    for (; UV; UV = UV->getNext())
      if (UV->match(Var, Offset))
        return UV;
  }

  UserValue *UV = new UserValue(Var, Offset, allocator);
  userValues.push_back(UV);
  Leader = UserValue::merge(Leader, UV);
  return UV;
}
예제 #3
0
UserValue *LDVImpl::getUserValue(const MDNode *Var, const MDNode *Expr,
                                 bool IsIndirect, const DebugLoc &DL) {
  UserValue *&Leader = userVarMap[Var];
  if (Leader) {
    UserValue *UV = Leader->getLeader();
    Leader = UV;
    for (; UV; UV = UV->getNext())
      if (UV->match(Var, Expr, DL->getInlinedAt(), IsIndirect))
        return UV;
  }

  userValues.push_back(
      llvm::make_unique<UserValue>(Var, Expr, IsIndirect, DL, allocator));
  UserValue *UV = userValues.back().get();
  Leader = UserValue::merge(Leader, UV);
  return UV;
}
예제 #4
0
UserValue *LDVImpl::getUserValue(const MDNode *Var, unsigned Offset,
                                 bool IsIndirect, DebugLoc DL) {
  UserValue *&Leader = userVarMap[Var];
  if (Leader) {
    UserValue *UV = Leader->getLeader();
    Leader = UV;
    for (; UV; UV = UV->getNext())
      if (UV->match(Var, Offset, IsIndirect))
        return UV;
  }

  userValues.push_back(
      make_unique<UserValue>(Var, Offset, IsIndirect, DL, allocator));
  UserValue *UV = userValues.back().get();
  Leader = UserValue::merge(Leader, UV);
  return UV;
}