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

Method UpgradeAtomics

source/opt/upgrade_memory_model.cpp:280–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280void 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
300void UpgradeMemoryModel::UpgradeSemantics(Instruction* inst,
301 uint32_t in_operand,

Callers

nothing calls this directly

Calls 4

spvOpcodeIsAtomicOpFunction · 0.85
ForEachInstMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected