lib/Analysis/BasicAliasAnalysis.cpp
bool BasicAAResult::isValueEqualInPotentialCycles(const Value *V,
                                                  const Value *V2) {
  if (V != V2)
    return false;

  const Instruction *Inst = dyn_cast<Instruction>(V);
  if (!Inst)
    return true;

  if (VisitedPhiBBs.empty())
    return true;

  if (VisitedPhiBBs.size() > MaxNumPhiBBsValueReachabilityCheck)
    return false;

  // Make sure that the visited phis cannot reach the Value. This ensures that
  // the Values cannot come from different iterations of a potential cycle the
  // phi nodes could be involved in.
  for (auto *P : VisitedPhiBBs)
    if (isPotentiallyReachable(&P->front(), Inst, nullptr, DT, LI))
      return false;

  return true;
}
/// Check whether two Values can be considered equivalent.
///
/// In addition to pointer equivalence of \p V1 and \p V2 this checks whether
/// they can not be part of a cycle in the value graph by looking at all
/// visited phi nodes an making sure that the phis cannot reach the value. We
/// have to do this because we are looking through phi nodes (That is we say
/// noalias(V, phi(VA, VB)) if noalias(V, VA) and noalias(V, VB).
Check whether two Values can be considered equivalent.
In addition to pointer equivalence of \p V1 and \p V2 this checks whether
they can not be part of a cycle in the value graph by looking at all
visited phi nodes an making sure that the phis cannot reach the value. We
have to do this because we are looking through phi nodes (That is we say
noalias(V, phi(VA, VB)) if noalias(V, VA) and noalias(V, VB).
Check whether two Values can be considered equivalent . In addition to pointer equivalence of \ p V1 and \ p V2 this checks whether they can not be part of a cycle in the value graph by looking at all visited phi nodes an making sure that the phis cannot reach the value . We have to do this because we are looking through phi nodes ( That is we say noalias ( V phi ( VA VB )) if noalias ( V VA ) and noalias ( V VB ) .
bool BasicAAResult::isValueEqualInPotentialCycles(const Value *V,
                                                  const Value *V2) {
  if (V != V2)
    return false;
  const Instruction *Inst = dyn_cast<Instruction>(V);
  if (!Inst)
    return true;
  if (VisitedPhiBBs.empty())
    return true;
  if (VisitedPhiBBs.size() > MaxNumPhiBBsValueReachabilityCheck)
    return false;
  for (auto *P : VisitedPhiBBs)
    if (isPotentiallyReachable(&P->front(), Inst, nullptr, DT, LI))
      return false;
  return true;
}
bool BasicAAResult :: isValueEqualInPotentialCycles ( const Value * V , const Value * V2 ) { if ( V != V2 ) return false ; const Instruction * Inst = dyn_cast < Instruction > ( V ) ; if ( ! Inst ) return true ; if ( VisitedPhiBBs . empty ( ) ) return true ; if ( VisitedPhiBBs . size ( ) > MaxNumPhiBBsValueReachabilityCheck ) return false ; for ( auto * P : VisitedPhiBBs ) if ( isPotentiallyReachable ( & P -> front ( ) , Inst , nullptr , DT , LI ) ) return false ; return true ; }
Check whether two Values can be considered equivalent.
Check whether two Values can be considered equivalent .
// Make sure that the visited phis cannot reach the Value. This ensures that // the Values cannot come from different iterations of a potential cycle the // phi nodes could be involved in.