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

Function FindEntryPoint

source/link/fnvar.cpp:117–127  ·  view source on GitHub ↗

Finds entry point corresponding to a function Returns null if not found, otherwise returns pointer to the EP Instruction.

Source from the content-addressed store, hash-verified

115//
116// Returns null if not found, otherwise returns pointer to the EP Instruction.
117Instruction* FindEntryPoint(const Instruction& fn_inst) {
118 auto* mod = fn_inst.context()->module();
119 for (auto& entry_point : mod->entry_points()) {
120 const int ep_i =
121 entry_point.opcode() == spv::Op::OpConditionalEntryPointINTEL ? 2 : 1;
122 if (entry_point.GetOperand(ep_i).AsId() == fn_inst.result_id()) {
123 return &entry_point;
124 }
125 }
126 return nullptr;
127}
128
129// If the function has an entry point, converts it to a conditional one
130void ConvertEPToConditional(Module* module, const Function& fn,

Callers 2

ConvertEPToConditionalFunction · 0.85
GetFnNameFunction · 0.85

Calls 6

entry_pointsMethod · 0.80
AsIdMethod · 0.80
moduleMethod · 0.45
contextMethod · 0.45
opcodeMethod · 0.45
result_idMethod · 0.45

Tested by

no test coverage detected