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

Function MaybeGetOpConstant

source/fuzz/fuzzer_util.cpp:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47uint32_t MaybeGetOpConstant(opt::IRContext* ir_context,
48 const TransformationContext& transformation_context,
49 const std::vector<uint32_t>& words,
50 uint32_t type_id, bool is_irrelevant) {
51 for (const auto& inst : ir_context->types_values()) {
52 if (inst.opcode() == spv::Op::OpConstant && inst.type_id() == type_id &&
53 inst.GetInOperand(0).words == words &&
54 transformation_context.GetFactManager()->IdIsIrrelevant(
55 inst.result_id()) == is_irrelevant) {
56 return inst.result_id();
57 }
58 }
59
60 return 0;
61}
62
63} // namespace
64

Callers 2

MaybeGetIntegerConstantFunction · 0.85
MaybeGetFloatConstantFunction · 0.85

Calls 6

GetFactManagerMethod · 0.80
types_valuesMethod · 0.45
opcodeMethod · 0.45
type_idMethod · 0.45
IdIsIrrelevantMethod · 0.45
result_idMethod · 0.45

Tested by

no test coverage detected