MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / parseRegion

Method parseRegion

lib/Bytecode/Reader/BytecodeReader.cpp:1263–1289  ·  view source on GitHub ↗

Helper function to parse a region during deserialization.

Source from the content-addressed store, hash-verified

1261
1262 /// Helper function to parse a region during deserialization.
1263 static LogicalResult
1264 parseRegion(EncodingReader &reader, OpBuilder &builder, Location loc,
1265 std::vector<Value> &parentValueIndexList,
1266 ArrayRef<ArrayRef<uint8_t>> constants, LazyTypeTable &types,
1267 DenseElementsAttrCache &constCache,
1268 DebugInfoReader::Iterator &diIterator, MLIRContext &context,
1269 Region &regionToPopulate,
1270 const BytecodeVersion &bytecodeVersion) {
1271 // Read number of blocks in the region.
1272 uint64_t numBlocks;
1273 if (failed(reader.readVarInt(numBlocks)))
1274 return reader.emitError() << "failed to read region block count";
1275
1276 // Parse each block in the region.
1277 for (uint64_t i = 0; i < numBlocks; ++i) {
1278 Block &currentBlock = regionToPopulate.emplaceBlock();
1279 // The value context for this block's arguments and operations starts
1280 // with values defined in the parent scope.
1281 if (failed(parseBlock(reader, builder, loc, currentBlock,
1282 parentValueIndexList, constants, types, constCache,
1283 diIterator, context, bytecodeVersion)))
1284 return reader.emitError()
1285 << "failed to parse block " << i << " in region.";
1286 }
1287
1288 return success();
1289 }
1290
1291 // ===----------------------------------------------------------------------===//
1292 // Helper Functions for Attribute Deserialization

Callers 4

CudaTile.cppFile · 0.80
parseArgumentRegionFunction · 0.80
parseMethod · 0.80
parseFuncOpFunction · 0.80

Calls 2

readVarIntMethod · 0.80
emitErrorMethod · 0.80

Tested by

no test coverage detected