Home | History | Annotate | Download | only in src

Lines Matching refs:Variable

1 //===- subzero/src/IceVariableSplitting.cpp - Local variable splitting ----===//
11 /// \brief Aggressive block-local variable splitting to improve linear-scan
29 /// A Variable is "allocable" if it is a register allocation candidate but
31 bool isAllocable(const Variable *Var) {
37 /// A Variable is "inf" if it already has a register or is infinite-weight.
38 bool isInf(const Variable *Var) {
46 /// last use of the Variable within the current block. For each entry, the
47 /// Variable is tagged with the CfgNode that it is valid in, so that we don't
56 /// MappedVar is the latest mapped/split version of the Variable.
57 Variable *MappedVar = nullptr;
60 /// LastUseInst is the last instruction in the block that uses the Variable
79 // the last use of each Variable within the block.
84 if (auto *SrcVar = llvm::dyn_cast<Variable>(Instr.getSrc(i))) {
93 Variable *get(Variable *Var) const {
95 Variable *MappedVar = Map[VarNum].MappedVar;
102 /// Create a new linked Variable in the LinkedTo chain, and set it as Var's
104 Variable *makeLinked(Variable *Var) {
105 Variable *NewVar = Func->makeVariable(Var->getType());
113 /// Given Var that is LinkedTo some other variable, re-splice it into the
114 /// LinkedTo chain so that the chain is ordered by Variable::getIndex().
115 void spliceBlockLocalLinkedToChain(Variable *Var) {
116 Variable *LinkedTo = Var->getLinkedTo();
120 Variable *Link = Map[VarNum].MappedVar;
123 Variable *LinkParent = Link->getLinkedTo();
131 /// Return whether the given Variable has any uses as a source operand within
133 /// dest variable in some instruction in the block, then we needn't bother
135 bool isDestUsedInBlock(const Variable *Dest) const {
138 /// Return whether the given instruction is the last use of the given Variable
140 /// Variable at this instruction.
141 bool isInstLastUseOfVar(const Variable *Var, const Inst *Instr) {
153 SizeT getVarNum(const Variable *Var) const {
181 for (Variable *Var : LinkedToFixups) {
275 /// Specially process a potential "Variable=Variable" assignment instruction,
282 auto *SrcVar = llvm::cast<Variable>(Instr->getSrc(0));
309 Variable *OldMapped = VarMap.get(SrcVar);
315 Variable *NewMapped = VarMap.makeLinked(SrcVar);
340 Variable *NewMapped = VarMap.makeLinked(Dest);
345 // original Dest mapping, without creating a new linked variable.
346 Variable *OldMapped = VarMap.get(Dest);
357 /// Process the dest Variable of a Phi instruction.
365 Variable *NewMapped = VarMap.makeLinked(Dest);
374 // The (non-variable-assignment) instruction:
393 if (auto *SrcVar = llvm::dyn_cast<Variable>(Instr->getSrc(i))) {
396 Variable *OldMapped = VarMap.get(SrcVar);
399 Variable *NewMapped = VarMap.makeLinked(SrcVar);
411 Variable *NewMapped = VarMap.makeLinked(Dest);
415 Variable *OldMapped = VarMap.get(Dest);
428 Variable *Dest = nullptr;
433 CfgVector<Variable *> LinkedToFixups;
442 /// Within each basic block, rewrite Variable references in terms of chained
443 /// copies of the original Variable. For example:
464 /// similar for the other Variable linked-to chains. Rewrites apply only to
478 /// new variable mapping. We try to pick a strategy most likely to avoid
516 CfgVector<Variable *> LinkedToFixups;