Lines Matching refs:use
112 var_inst, [&store_inst, var_inst](Instruction* use) { in FindStoreInstruction() argument
113 if (use->opcode() == SpvOpStore && in FindStoreInstruction()
114 use->GetSingleWordInOperand(kStorePointerInOperand) == in FindStoreInstruction()
117 store_inst = use; in FindStoreInstruction()
156 return get_def_use_mgr()->WhileEachUser(ptr_inst, [this](Instruction* use) { in HasNoStores() argument
157 if (use->opcode() == SpvOpLoad) { in HasNoStores()
159 } else if (use->opcode() == SpvOpAccessChain) { in HasNoStores()
160 return HasNoStores(use); in HasNoStores()
161 } else if (use->IsDecoration() || use->opcode() == SpvOpName) { in HasNoStores()
163 } else if (use->opcode() == SpvOpStore) { in HasNoStores()
165 } else if (use->opcode() == SpvOpImageTexelPointer) { in HasNoStores()
181 [this, store_inst, dominator_analysis, ptr_inst](Instruction* use) { in HasValidReferencesOnly() argument
182 if (use->opcode() == SpvOpLoad || in HasValidReferencesOnly()
183 use->opcode() == SpvOpImageTexelPointer) { in HasValidReferencesOnly()
187 return dominator_analysis->Dominates(store_inst, use); in HasValidReferencesOnly()
188 } else if (use->opcode() == SpvOpAccessChain) { in HasValidReferencesOnly()
189 return HasValidReferencesOnly(use, store_inst); in HasValidReferencesOnly()
190 } else if (use->IsDecoration() || use->opcode() == SpvOpName) { in HasValidReferencesOnly()
192 } else if (use->opcode() == SpvOpStore) { in HasValidReferencesOnly()
197 } else if (IsOpenCL100DebugDeclareOrValue(use)) { in HasValidReferencesOnly()
501 type](Instruction* use, in CanUpdateUses()
503 if (IsOpenCL100DebugDeclareOrValue(use)) return true; in CanUpdateUses()
505 switch (use->opcode()) { in CanUpdateUses()
510 if (new_type_id != use->type_id()) { in CanUpdateUses()
511 return CanUpdateUses(use, new_type_id); in CanUpdateUses()
520 for (uint32_t i = 1; i < use->NumInOperands(); ++i) { in CanUpdateUses()
522 const_mgr->FindDeclaredConstant(use->GetSingleWordInOperand(i)); in CanUpdateUses()
542 if (new_pointer_type_id != use->type_id()) { in CanUpdateUses()
543 return CanUpdateUses(use, new_pointer_type_id); in CanUpdateUses()
549 for (uint32_t i = 1; i < use->NumInOperands(); ++i) { in CanUpdateUses()
550 access_chain.push_back(use->GetSingleWordInOperand(i)); in CanUpdateUses()
560 if (new_type_id != use->type_id()) { in CanUpdateUses()
561 return CanUpdateUses(use, new_type_id); in CanUpdateUses()
574 return use->IsDecoration(); in CanUpdateUses()
587 [&uses](Instruction* use, uint32_t index) { in UpdateUses() argument
588 uses.push_back({use, index}); in UpdateUses()
592 Instruction* use = pair.first; in UpdateUses() local
595 if (use->IsOpenCL100DebugInstr()) { in UpdateUses()
596 switch (use->GetOpenCL100DebugOpcode()) { in UpdateUses()
600 context()->ForgetUses(use); in UpdateUses()
601 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
602 context()->AnalyzeUses(use); in UpdateUses()
608 context()->ForgetUses(use); in UpdateUses()
611 use->SetOperand( in UpdateUses()
614 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
618 def_use_mgr->GetDef(use->GetSingleWordOperand(index + 1)); in UpdateUses()
621 use->SetOperand(index + 1, {deref_expr_instr->result_id()}); in UpdateUses()
624 context()->AnalyzeUses(use); in UpdateUses()
629 context()->ForgetUses(use); in UpdateUses()
630 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
631 context()->AnalyzeUses(use); in UpdateUses()
640 switch (use->opcode()) { in UpdateUses()
643 context()->ForgetUses(use); in UpdateUses()
644 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
651 if (new_type_id != use->type_id()) { in UpdateUses()
652 use->SetResultType(new_type_id); in UpdateUses()
653 context()->AnalyzeUses(use); in UpdateUses()
654 UpdateUses(use, use); in UpdateUses()
656 context()->AnalyzeUses(use); in UpdateUses()
661 context()->ForgetUses(use); in UpdateUses()
662 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
667 for (uint32_t i = 1; i < use->NumInOperands(); ++i) { in UpdateUses()
669 const_mgr->FindDeclaredConstant(use->GetSingleWordInOperand(i)); in UpdateUses()
693 if (new_pointer_type_id != use->type_id()) { in UpdateUses()
694 use->SetResultType(new_pointer_type_id); in UpdateUses()
695 context()->AnalyzeUses(use); in UpdateUses()
696 UpdateUses(use, use); in UpdateUses()
698 context()->AnalyzeUses(use); in UpdateUses()
703 context()->ForgetUses(use); in UpdateUses()
704 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
708 for (uint32_t i = 1; i < use->NumInOperands(); ++i) { in UpdateUses()
709 access_chain.push_back(use->GetSingleWordInOperand(i)); in UpdateUses()
714 if (new_type_id != use->type_id()) { in UpdateUses()
715 use->SetResultType(new_type_id); in UpdateUses()
716 context()->AnalyzeUses(use); in UpdateUses()
717 UpdateUses(use, use); in UpdateUses()
719 context()->AnalyzeUses(use); in UpdateUses()
733 use->GetSingleWordInOperand(kStorePointerInOperand)); in UpdateUses()
738 uint32_t copy = GenerateCopy(original_ptr_inst, pointee_type_id, use); in UpdateUses()
740 context()->ForgetUses(use); in UpdateUses()
741 use->SetInOperand(index, {copy}); in UpdateUses()
742 context()->AnalyzeUses(use); in UpdateUses()
751 context()->ForgetUses(use); in UpdateUses()
752 use->SetOperand(index, {new_ptr_inst->result_id()}); in UpdateUses()
753 context()->AnalyzeUses(use); in UpdateUses()