| 5364 | //===----------------------------------------------------------------------===// |
| 5365 | |
| 5366 | LogicalResult |
| 5367 | cuda_tile::impl::verifyMemoryModelStore(Operation *op, |
| 5368 | MemoryOrderingSemantics memoryOrdering, |
| 5369 | std::optional<MemoryScope> scope) { |
| 5370 | // First validate the memory ordering is supported |
| 5371 | switch (memoryOrdering) { |
| 5372 | case MemoryOrderingSemantics::WEAK: |
| 5373 | case MemoryOrderingSemantics::RELAXED: |
| 5374 | case MemoryOrderingSemantics::RELEASE: |
| 5375 | break; // Valid orderings |
| 5376 | default: |
| 5377 | return op->emitOpError( |
| 5378 | "expect one of: weak, relaxed, or release, but got: ") |
| 5379 | << stringifyMemoryOrderingSemantics(memoryOrdering); |
| 5380 | } |
| 5381 | |
| 5382 | // Then validate scope requirements based on ordering |
| 5383 | if (memoryOrdering == MemoryOrderingSemantics::WEAK) { |
| 5384 | if (scope.has_value()) |
| 5385 | return op->emitOpError("weak store must not have memory scope"); |
| 5386 | } else { |
| 5387 | // RELAXED or RELEASE require scope |
| 5388 | if (!scope.has_value()) |
| 5389 | return op->emitOpError("memory scope is required for ") |
| 5390 | << stringifyMemoryOrderingSemantics(memoryOrdering) << " store"; |
| 5391 | } |
| 5392 | return success(); |
| 5393 | } |
| 5394 | |
| 5395 | //===----------------------------------------------------------------------===// |
| 5396 | // StorePtrTkoOp |
nothing calls this directly
no outgoing calls
no test coverage detected