| 60 | } |
| 61 | |
| 62 | cuda_tile::ModuleOp cuda_tile::extractCudaTileModuleOp(Operation *op) { |
| 63 | // Try direct cast first |
| 64 | if (auto directCudaTileModule = dyn_cast<cuda_tile::ModuleOp>(op)) |
| 65 | return directCudaTileModule; |
| 66 | |
| 67 | // Try nested case: look inside a regular ModuleOp |
| 68 | if (auto moduleOp = dyn_cast<mlir::ModuleOp>(op)) { |
| 69 | if (!moduleOp.getBody()->empty()) { |
| 70 | if (auto nestedCudaTileModule = |
| 71 | dyn_cast<cuda_tile::ModuleOp>(&moduleOp.getBody()->front())) |
| 72 | return nestedCudaTileModule; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // Not found |
| 77 | return {}; |
| 78 | } |
| 79 | |
| 80 | namespace { |
| 81 |
nothing calls this directly
no outgoing calls
no test coverage detected