Lines Matching refs:varId

81   uint32_t varId = ptrId;  in IsPtr()  local
82 Instruction* ptrInst = get_def_use_mgr()->GetDef(varId); in IsPtr()
84 varId = ptrInst->GetSingleWordInOperand(kCopyObjectOperandInIdx); in IsPtr()
85 ptrInst = get_def_use_mgr()->GetDef(varId); in IsPtr()
95 Instruction* MemPass::GetPtr(uint32_t ptrId, uint32_t* varId) { in GetPtr() argument
96 *varId = ptrId; in GetPtr()
97 Instruction* ptrInst = get_def_use_mgr()->GetDef(*varId); in GetPtr()
107 *varId = varInst->result_id(); in GetPtr()
109 *varId = 0; in GetPtr()
120 Instruction* MemPass::GetPtr(Instruction* ip, uint32_t* varId) { in GetPtr() argument
126 return GetPtr(ptrId, varId); in GetPtr()
143 bool MemPass::HasLoads(uint32_t varId) const { in HasLoads()
144 return !get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { in HasLoads()
159 bool MemPass::IsLiveVar(uint32_t varId) const { in IsLiveVar()
160 const Instruction* varInst = get_def_use_mgr()->GetDef(varId); in IsLiveVar()
170 return HasLoads(varId); in IsLiveVar()
198 uint32_t varId = 0; in DCEInst() local
200 if (di->opcode() == SpvOpLoad) (void)GetPtr(di, &varId); in DCEInst()
214 if (varId != 0 && !IsLiveVar(varId)) AddStores(varId, &deadInsts); in DCEInst()
221 bool MemPass::HasOnlySupportedRefs(uint32_t varId) { in HasOnlySupportedRefs() argument
222 return get_def_use_mgr()->WhileEachUser(varId, [this](Instruction* user) { in HasOnlySupportedRefs()
244 bool MemPass::IsTargetVar(uint32_t varId) { in IsTargetVar() argument
245 if (varId == 0) { in IsTargetVar()
249 if (seen_non_target_vars_.find(varId) != seen_non_target_vars_.end()) in IsTargetVar()
251 if (seen_target_vars_.find(varId) != seen_target_vars_.end()) return true; in IsTargetVar()
252 const Instruction* varInst = get_def_use_mgr()->GetDef(varId); in IsTargetVar()
258 seen_non_target_vars_.insert(varId); in IsTargetVar()
265 seen_non_target_vars_.insert(varId); in IsTargetVar()
268 seen_target_vars_.insert(varId); in IsTargetVar()
480 uint32_t varId; in CollectTargetVars() local
481 (void)GetPtr(&inst, &varId); in CollectTargetVars()
482 if (!IsTargetVar(varId)) break; in CollectTargetVars()
483 if (HasOnlySupportedRefs(varId)) break; in CollectTargetVars()
484 seen_non_target_vars_.insert(varId); in CollectTargetVars()
485 seen_target_vars_.erase(varId); in CollectTargetVars()