| 278 | } |
| 279 | |
| 280 | void UpgradeMemoryModel::UpgradeAtomics() { |
| 281 | for (auto& func : *get_module()) { |
| 282 | func.ForEachInst([this](Instruction* inst) { |
| 283 | if (spvOpcodeIsAtomicOp(inst->opcode())) { |
| 284 | bool unused_coherent = false; |
| 285 | bool is_volatile = false; |
| 286 | spv::Scope unused_scope = spv::Scope::QueueFamilyKHR; |
| 287 | std::tie(unused_coherent, is_volatile, unused_scope) = |
| 288 | GetInstructionAttributes(inst->GetSingleWordInOperand(0)); |
| 289 | |
| 290 | UpgradeSemantics(inst, 2u, is_volatile); |
| 291 | if (inst->opcode() == spv::Op::OpAtomicCompareExchange || |
| 292 | inst->opcode() == spv::Op::OpAtomicCompareExchangeWeak) { |
| 293 | UpgradeSemantics(inst, 3u, is_volatile); |
| 294 | } |
| 295 | } |
| 296 | }); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | void UpgradeMemoryModel::UpgradeSemantics(Instruction* inst, |
| 301 | uint32_t in_operand, |
nothing calls this directly
no test coverage detected