MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ClearInst

Method ClearInst

source/opt/def_use_manager.cpp:232–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void DefUseManager::ClearInst(Instruction* inst) {
233 auto iter = inst_to_used_ids_.find(inst);
234 if (iter != inst_to_used_ids_.end()) {
235 EraseUseRecordsOfOperandIds(inst);
236 if (inst->result_id() != 0) {
237 // Remove all uses of this inst.
238 auto users_begin = UsersBegin(inst);
239 auto end = id_to_users_.end();
240 auto new_end = users_begin;
241 for (; UsersNotEnd(new_end, end, inst); ++new_end) {
242 }
243 id_to_users_.erase(users_begin, new_end);
244 id_to_def_.erase(inst->result_id());
245 }
246 }
247}
248
249void DefUseManager::EraseUseRecordsOfOperandIds(const Instruction* inst) {
250 // Go through all ids used by this instruction, remove this instruction's

Callers 3

KillInstMethod · 0.80
ClearDbgLineInstsMethod · 0.80
EliminateFunctionFunction · 0.80

Calls 3

endMethod · 0.45
result_idMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected