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

Method getOpIndex

lib/Bytecode/Writer/BytecodeWriter.cpp:586–602  ·  view source on GitHub ↗

This method gets or creates an index for an operation.

Source from the content-addressed store, hash-verified

584
585 /// This method gets or creates an index for an operation.
586 uint64_t getOpIndex(Operation *op) {
587 auto it = opIndexMap.find(op);
588 if (it != opIndexMap.end())
589 return it->second;
590
591 // Check if the operation location has a reserved index and return it.
592 auto reserved = getDebugReserved(op->getLoc());
593 if (reserved != Bytecode::DebugReserved::SIZE)
594 return static_cast<uint64_t>(reserved);
595
596 // Adjust the index to account for reserved indices.
597 uint64_t opIndex = opIndexMap.size() +
598 static_cast<uint64_t>(Bytecode::DebugReserved::SIZE);
599
600 opIndexMap[op] = opIndex;
601 return opIndex;
602 }
603
604 /// This method adds a debug info attribute to an operation.
605 void addDebugInfo(uint64_t opIndex, Attribute attr) {

Callers 2

writeOperationMethod · 0.80
buildFunctionMapMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected