• Home
  • Raw
  • Download

Lines Matching refs:varId

82   uint32_t varId = ptrId;  in IsPtr()  local
83 Instruction* ptrInst = get_def_use_mgr()->GetDef(varId); in IsPtr()
85 varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); in IsPtr()
86 ptrInst = get_def_use_mgr()->GetDef(varId); in IsPtr()
96 Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { in GetPtr() argument
97 *varId = ptrId; in GetPtr()
98 Instruction* ptrInst = get_def_use_mgr()->GetDef(*varId); in GetPtr()
102 *varId = 0; in GetPtr()
113 *varId = varInst->result_id(); in GetPtr()
115 *varId = 0; in GetPtr()
126 Instruction* MemPass::GetPtr(Instruction* ip, uint32_t* varId) { in GetPtr() argument
132 return GetPtr(ptrId, varId); in GetPtr()
149 bool MemPass::HasLoads(uint32_t varId) const { in HasLoads()
150 return !get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { in HasLoads()
165 bool MemPass::IsLiveVar(uint32_t varId) const { in IsLiveVar()
166 const Instruction* varInst = get_def_use_mgr()->GetDef(varId); in IsLiveVar()
176 return HasLoads(varId); in IsLiveVar()
204 uint32_t varId = 0; in DCEInst() local
206 if (di->opcode() == SpvOpLoad) (void)GetPtr(di, &varId); in DCEInst()
220 if (varId != 0 && !IsLiveVar(varId)) AddStores(varId, &deadInsts); in DCEInst()
227 bool MemPass::HasOnlySupportedRefs(uint32_t varId) { in HasOnlySupportedRefs() argument
228 return get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { in HasOnlySupportedRefs()
259 bool MemPass::IsTargetVar(uint32_t varId) { in IsTargetVar() argument
260 if (varId == 0) { in IsTargetVar()
264 if (seen_non_target_vars_.find(varId) != seen_non_target_vars_.end()) in IsTargetVar()
266 if (seen_target_vars_.find(varId) != seen_target_vars_.end()) return true; in IsTargetVar()
267 const Instruction* varInst = get_def_use_mgr()->GetDef(varId); in IsTargetVar()
273 seen_non_target_vars_.insert(varId); in IsTargetVar()
280 seen_non_target_vars_.insert(varId); in IsTargetVar()
283 seen_target_vars_.insert(varId); in IsTargetVar()
495 uint32_t varId; in CollectTargetVars() local
496 (void)GetPtr(&inst, &varId); in CollectTargetVars()
497 if (!IsTargetVar(varId)) break; in CollectTargetVars()
498 if (HasOnlySupportedRefs(varId)) break; in CollectTargetVars()
499 seen_non_target_vars_.insert(varId); in CollectTargetVars()
500 seen_target_vars_.erase(varId); in CollectTargetVars()