19void SPIRVGeneralDuplicatesTracker::prebuildReg2Entry(
22 for (
auto &RegPair : TPair.second) {
28 Reg2Entry[&
MI->getOperand(0)] = &TPair.second;
34 std::vector<SPIRV::DTSortableEntry *> &Graph,
37 prebuildReg2Entry(TT, Reg2Entry);
38 prebuildReg2Entry(CT, Reg2Entry);
39 prebuildReg2Entry(GT, Reg2Entry);
40 prebuildReg2Entry(FT, Reg2Entry);
41 prebuildReg2Entry(AT, Reg2Entry);
42 prebuildReg2Entry(MT, Reg2Entry);
43 prebuildReg2Entry(ST, Reg2Entry);
45 for (
auto &Op2E : Reg2Entry) {
53 assert(
MI &&
MI->getParent() &&
"No MachineInstr created yet");
54 for (
auto i =
MI->getNumDefs(); i < MI->getNumOperands(); i++) {
63 if (
MI->getOpcode() == SPIRV::OpConstantFunctionPointerINTEL && i == 2)
66 assert((
MI->getOpcode() == SPIRV::OpVariable && i == 3) ||
67 Reg2Entry.
count(RegOp));
68 if (Reg2Entry.
count(RegOp))
69 E->
addDep(Reg2Entry[RegOp]);
74 if (Next && (Next->
getOpcode() == SPIRV::OpFunction ||
75 Next->
getOpcode() == SPIRV::OpFunctionParameter)) {
82#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
84 const Module *M = MMI->getModule();
85 for (
auto F = M->begin(), E = M->end();
F != E; ++
F) {
93 if (
MI.getNumExplicitDefs() > 0 &&
94 Reg2Entry.
count(&
MI.getOperand(0))) {
97 Reg2Entry.
lookup(&
MI.getOperand(0))->getDeps())
unsigned const MachineRegisterInfo * MRI
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class represents an Operation in the Expression.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
This class contains meta information specific to a module.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
MachineInstr * getUniqueVRegDef(Register Reg) const
getUniqueVRegDef - Return the unique machine instr that defines the specified virtual register or nul...
This class implements a map that also provides access to all stored values in a deterministic order.
size_type count(const KeyT &Key) const
ValueT lookup(const KeyT &Key) const
A Module instance is used to store all the information related to an LLVM module.
Wrapper class representing virtual and physical registers.
static unsigned virtReg2Index(Register Reg)
Convert a virtual register number to a 0-based index.
const StorageTy & getAllUses() const
void buildDepsGraph(std::vector< SPIRV::DTSortableEntry * > &Graph, MachineModuleInfo *MMI)
void addDep(DTSortableEntry *E)
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.