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

Method CollectInterfaceVariables

source/opt/interface_var_sroa.cpp:185–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185std::vector<Instruction*>
186InterfaceVariableScalarReplacement::CollectInterfaceVariables(
187 Instruction& entry_point) {
188 std::vector<Instruction*> interface_vars;
189 for (uint32_t i = kOpEntryPointInOperandInterface;
190 i < entry_point.NumInOperands(); ++i) {
191 Instruction* interface_var = context()->get_def_use_mgr()->GetDef(
192 entry_point.GetSingleWordInOperand(i));
193 assert(interface_var->opcode() == spv::Op::OpVariable);
194
195 spv::StorageClass storage_class = GetStorageClass(interface_var);
196 if (storage_class != spv::StorageClass::Input &&
197 storage_class != spv::StorageClass::Output) {
198 continue;
199 }
200
201 interface_vars.push_back(interface_var);
202 }
203 return interface_vars;
204}
205
206void InterfaceVariableScalarReplacement::KillInstructionAndUsers(
207 Instruction* inst) {

Callers

nothing calls this directly

Calls 7

NumInOperandsMethod · 0.80
GetStorageClassFunction · 0.70
GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45
opcodeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected