#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineDominanceFrontier.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RDFGraph.h"
#include "llvm/CodeGen/RDFRegisters.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/LaneBitmask.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <iterator>
#include <set>
#include <utility>
#include <vector>
namespace llvm::rdf {
raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterRef> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<NodeId> &P) { … }
static void printRefHeader(raw_ostream &OS, const Ref RA,
const DataFlowGraph &G) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Def> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Use> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<PhiUse> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Ref> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<NodeList> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<NodeSet> &P) { … }
namespace {
template <typename T> struct PrintListV { … };
template <typename T>
raw_ostream &operator<<(raw_ostream &OS, const PrintListV<T> &P) { … }
}
raw_ostream &operator<<(raw_ostream &OS, const Print<Phi> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Stmt> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Instr> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Block> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<Func> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterSet> &P) { … }
raw_ostream &operator<<(raw_ostream &OS, const Print<RegisterAggr> &P) { … }
raw_ostream &operator<<(raw_ostream &OS,
const Print<DataFlowGraph::DefStack> &P) { … }
void NodeAllocator::startNewBlock() { … }
bool NodeAllocator::needNewBlock() { … }
Node NodeAllocator::New() { … }
NodeId NodeAllocator::id(const NodeBase *P) const { … }
void NodeAllocator::clear() { … }
void NodeBase::append(Node NA) { … }
RegisterRef RefNode::getRegRef(const DataFlowGraph &G) const { … }
void RefNode::setRegRef(RegisterRef RR, DataFlowGraph &G) { … }
void RefNode::setRegRef(MachineOperand *Op, DataFlowGraph &G) { … }
Node RefNode::getOwner(const DataFlowGraph &G) { … }
void DefNode::linkToDef(NodeId Self, Def DA) { … }
void UseNode::linkToDef(NodeId Self, Def DA) { … }
Node CodeNode::getFirstMember(const DataFlowGraph &G) const { … }
Node CodeNode::getLastMember(const DataFlowGraph &G) const { … }
void CodeNode::addMember(Node NA, const DataFlowGraph &G) { … }
void CodeNode::addMemberAfter(Node MA, Node NA, const DataFlowGraph &G) { … }
void CodeNode::removeMember(Node NA, const DataFlowGraph &G) { … }
NodeList CodeNode::members(const DataFlowGraph &G) const { … }
Node InstrNode::getOwner(const DataFlowGraph &G) { … }
void BlockNode::addPhi(Phi PA, const DataFlowGraph &G) { … }
Block FuncNode::findBlock(const MachineBasicBlock *BB,
const DataFlowGraph &G) const { … }
Block FuncNode::getEntryBlock(const DataFlowGraph &G) { … }
bool TargetOperandInfo::isPreserving(const MachineInstr &In,
unsigned OpNum) const { … }
bool TargetOperandInfo::isClobbering(const MachineInstr &In,
unsigned OpNum) const { … }
bool TargetOperandInfo::isFixedReg(const MachineInstr &In,
unsigned OpNum) const { … }
DataFlowGraph::DataFlowGraph(MachineFunction &mf, const TargetInstrInfo &tii,
const TargetRegisterInfo &tri,
const MachineDominatorTree &mdt,
const MachineDominanceFrontier &mdf)
: … { … }
DataFlowGraph::DataFlowGraph(MachineFunction &mf, const TargetInstrInfo &tii,
const TargetRegisterInfo &tri,
const MachineDominatorTree &mdt,
const MachineDominanceFrontier &mdf,
const TargetOperandInfo &toi)
: … { … }
DataFlowGraph::DefStack::Iterator::Iterator(const DataFlowGraph::DefStack &S,
bool Top)
: … { … }
unsigned DataFlowGraph::DefStack::size() const { … }
void DataFlowGraph::DefStack::pop() { … }
void DataFlowGraph::DefStack::start_block(NodeId N) { … }
void DataFlowGraph::DefStack::clear_block(NodeId N) { … }
unsigned DataFlowGraph::DefStack::nextUp(unsigned P) const { … }
unsigned DataFlowGraph::DefStack::nextDown(unsigned P) const { … }
RegisterAggr DataFlowGraph::getLandingPadLiveIns() const { … }
NodeBase *DataFlowGraph::ptr(NodeId N) const { … }
NodeId DataFlowGraph::id(const NodeBase *P) const { … }
Node DataFlowGraph::newNode(uint16_t Attrs) { … }
Node DataFlowGraph::cloneNode(const Node B) { … }
Use DataFlowGraph::newUse(Instr Owner, MachineOperand &Op, uint16_t Flags) { … }
PhiUse DataFlowGraph::newPhiUse(Phi Owner, RegisterRef RR, Block PredB,
uint16_t Flags) { … }
Def DataFlowGraph::newDef(Instr Owner, MachineOperand &Op, uint16_t Flags) { … }
Def DataFlowGraph::newDef(Instr Owner, RegisterRef RR, uint16_t Flags) { … }
Phi DataFlowGraph::newPhi(Block Owner) { … }
Stmt DataFlowGraph::newStmt(Block Owner, MachineInstr *MI) { … }
Block DataFlowGraph::newBlock(Func Owner, MachineBasicBlock *BB) { … }
Func DataFlowGraph::newFunc(MachineFunction *MF) { … }
void DataFlowGraph::build(const Config &config) { … }
RegisterRef DataFlowGraph::makeRegRef(unsigned Reg, unsigned Sub) const { … }
RegisterRef DataFlowGraph::makeRegRef(const MachineOperand &Op) const { … }
void DataFlowGraph::markBlock(NodeId B, DefStackMap &DefM) { … }
void DataFlowGraph::releaseBlock(NodeId B, DefStackMap &DefM) { … }
void DataFlowGraph::pushAllDefs(Instr IA, DefStackMap &DefM) { … }
void DataFlowGraph::pushClobbers(Instr IA, DefStackMap &DefM) { … }
void DataFlowGraph::pushDefs(Instr IA, DefStackMap &DefM) { … }
NodeList DataFlowGraph::getRelatedRefs(Instr IA, Ref RA) const { … }
void DataFlowGraph::reset() { … }
Ref DataFlowGraph::getNextRelated(Instr IA, Ref RA) const { … }
template <typename Predicate>
std::pair<Ref, Ref> DataFlowGraph::locateNextRef(Instr IA, Ref RA,
Predicate P) const { … }
Ref DataFlowGraph::getNextShadow(Instr IA, Ref RA, bool Create) { … }
void DataFlowGraph::buildStmt(Block BA, MachineInstr &In) { … }
void DataFlowGraph::recordDefsForDF(BlockRefsMap &PhiM, Block BA) { … }
void DataFlowGraph::buildPhis(BlockRefsMap &PhiM, Block BA) { … }
void DataFlowGraph::removeUnusedPhis() { … }
template <typename T>
void DataFlowGraph::linkRefUp(Instr IA, NodeAddr<T> TA, DefStack &DS) { … }
template <typename Predicate>
void DataFlowGraph::linkStmtRefs(DefStackMap &DefM, Stmt SA, Predicate P) { … }
void DataFlowGraph::linkBlockRefs(DefStackMap &DefM, Block BA) { … }
void DataFlowGraph::unlinkUseDF(Use UA) { … }
void DataFlowGraph::unlinkDefDF(Def DA) { … }
bool DataFlowGraph::isTracked(RegisterRef RR) const { … }
bool DataFlowGraph::hasUntrackedRef(Stmt S, bool IgnoreReserved) const { … }
}