| 222 | } |
| 223 | |
| 224 | bool InterestingWhileOpcodeExists(const std::vector<uint32_t>& binary, |
| 225 | spv::Op opcode, uint32_t count, bool dump) { |
| 226 | if (dump) { |
| 227 | std::stringstream ss; |
| 228 | ss << "temp_" << count << ".spv"; |
| 229 | DumpShader(binary, ss.str().c_str()); |
| 230 | } |
| 231 | |
| 232 | std::unique_ptr<opt::IRContext> context = |
| 233 | BuildModule(kEnv, kMessageConsumer, binary.data(), binary.size()); |
| 234 | assert(context); |
| 235 | bool interesting = false; |
| 236 | for (auto& function : *context->module()) { |
| 237 | context->cfg()->ForEachBlockInPostOrder( |
| 238 | &*function.begin(), |
| 239 | [opcode, &interesting](opt::BasicBlock* block) -> void { |
| 240 | for (auto& inst : *block) { |
| 241 | if (inst.opcode() == spv::Op(opcode)) { |
| 242 | interesting = true; |
| 243 | break; |
| 244 | } |
| 245 | } |
| 246 | }); |
| 247 | if (interesting) { |
| 248 | break; |
| 249 | } |
| 250 | } |
| 251 | return interesting; |
| 252 | } |
| 253 | |
| 254 | bool InterestingWhileIMulReachable(const std::vector<uint32_t>& binary, |
| 255 | uint32_t count) { |
no test coverage detected