| 2139 | } |
| 2140 | |
| 2141 | void Differ::MatchExtInstImportIds() { |
| 2142 | // Bunch all of this section's ids as potential matches. |
| 2143 | PotentialIdMap potential_id_map; |
| 2144 | auto get_result_id = [](const opt::Instruction& inst) { |
| 2145 | return inst.result_id(); |
| 2146 | }; |
| 2147 | auto accept_all = [](const opt::Instruction&) { return true; }; |
| 2148 | |
| 2149 | PoolPotentialIds(src_->ext_inst_imports(), potential_id_map.src_ids, true, |
| 2150 | accept_all, get_result_id); |
| 2151 | PoolPotentialIds(dst_->ext_inst_imports(), potential_id_map.dst_ids, false, |
| 2152 | accept_all, get_result_id); |
| 2153 | |
| 2154 | // Then match the ids. |
| 2155 | MatchIds(potential_id_map, [](const opt::Instruction* src_inst, |
| 2156 | const opt::Instruction* dst_inst) { |
| 2157 | // Match OpExtInstImport by exact name, which is operand 1 |
| 2158 | const opt::Operand& src_name = src_inst->GetOperand(1); |
| 2159 | const opt::Operand& dst_name = dst_inst->GetOperand(1); |
| 2160 | |
| 2161 | return src_name.AsString() == dst_name.AsString(); |
| 2162 | }); |
| 2163 | } |
| 2164 | void Differ::MatchMemoryModel() { |
| 2165 | // Always match the memory model instructions, there is always a single one of |
| 2166 | // it. |
no test coverage detected