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

Method parseOperation

lib/Bytecode/Reader/BytecodeReader.cpp:1851–1881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1849#include "BytecodeReader.inc"
1850
1851 static LogicalResult
1852 parseOperation(EncodingReader &reader, OpBuilder &innerBuilder,
1853 std::vector<Value> &valueIndexList,
1854 ArrayRef<ArrayRef<uint8_t>> constants, LazyTypeTable &types,
1855 DenseElementsAttrCache &constCache,
1856 DebugInfoReader::Iterator &diIterator, MLIRContext &context,
1857 const BytecodeVersion &bytecodeVersion) {
1858 uint64_t opcode;
1859 if (failed(reader.readVarInt(opcode)))
1860 return reader.emitError() << "failed to read operation opcode.";
1861
1862 // Version checking for public operations.
1863 uint32_t opcodeValue = static_cast<uint32_t>(opcode);
1864 if (!mlir::cuda_tile::detail::isOpcodeAvailableInVersion(opcodeValue,
1865 bytecodeVersion))
1866 return reader.emitError()
1867 << "unsupported opcode " << opcodeValue << " for bytecode version "
1868 << bytecodeVersion.toString();
1869
1870 // Get the location for this operation.
1871 auto loc = diIterator.next<LocationAttr>();
1872 if (!loc)
1873 return reader.emitError() << "failed to read operation location.";
1874
1875 // Includes the generated switch statement for dispatching to the
1876 // appropriate 'parse<OpName>' function based on the opcode.
1877#define GEN_OP_READER_DISPATCH
1878#include "BytecodeReader.inc"
1879
1880 return success();
1881 }
1882};
1883
1884} // namespace

Callers

nothing calls this directly

Calls 3

readVarIntMethod · 0.80
emitErrorMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected