llvm/llvm/lib/Analysis/PHITransAddr.cpp

//===- PHITransAddr.cpp - PHI Translation for Addresses -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the PHITransAddr class.
//
//===----------------------------------------------------------------------===//

#include "llvm/Analysis/PHITransAddr.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;

static cl::opt<bool> EnableAddPhiTranslation(
    "gvn-add-phi-translation", cl::init(false), cl::Hidden,
    cl::desc("Enable phi-translation of add instructions"));

static bool canPHITrans(Instruction *Inst) {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void PHITransAddr::dump() const {
  if (!Addr) {
    dbgs() << "PHITransAddr: null\n";
    return;
  }
  dbgs() << "PHITransAddr: " << *Addr << "\n";
  for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
    dbgs() << "  Input #" << i << " is " << *InstInputs[i] << "\n";
}
#endif

static bool verifySubExpr(Value *Expr,
                          SmallVectorImpl<Instruction *> &InstInputs) {}

/// verify - Check internal consistency of this data structure.  If the
/// structure is valid, it returns true.  If invalid, it prints errors and
/// returns false.
bool PHITransAddr::verify() const {}

/// isPotentiallyPHITranslatable - If this needs PHI translation, return true
/// if we have some hope of doing it.  This should be used as a filter to
/// avoid calling PHITranslateValue in hopeless situations.
bool PHITransAddr::isPotentiallyPHITranslatable() const {}

static void RemoveInstInputs(Value *V,
                             SmallVectorImpl<Instruction*> &InstInputs) {}

Value *PHITransAddr::translateSubExpr(Value *V, BasicBlock *CurBB,
                                      BasicBlock *PredBB,
                                      const DominatorTree *DT) {}

/// PHITranslateValue - PHI translate the current address up the CFG from
/// CurBB to Pred, updating our state to reflect any needed changes.  If
/// 'MustDominate' is true, the translated value must dominate PredBB.
Value *PHITransAddr::translateValue(BasicBlock *CurBB, BasicBlock *PredBB,
                                    const DominatorTree *DT,
                                    bool MustDominate) {}

/// PHITranslateWithInsertion - PHI translate this value into the specified
/// predecessor block, inserting a computation of the value if it is
/// unavailable.
///
/// All newly created instructions are added to the NewInsts list.  This
/// returns null on failure.
///
Value *
PHITransAddr::translateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
                                     const DominatorTree &DT,
                                     SmallVectorImpl<Instruction *> &NewInsts) {}

/// insertTranslatedSubExpr - Insert a computation of the PHI translated
/// version of 'V' for the edge PredBB->CurBB into the end of the PredBB
/// block.  All newly created instructions are added to the NewInsts list.
/// This returns null on failure.
///
Value *PHITransAddr::insertTranslatedSubExpr(
    Value *InVal, BasicBlock *CurBB, BasicBlock *PredBB,
    const DominatorTree &DT, SmallVectorImpl<Instruction *> &NewInsts) {}