| 45 | }; |
| 46 | |
| 47 | uint32_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 |
no test coverage detected