15#ifndef CIRCT_DIALECT_SYNTH_ANALYSIS_RESOURCEUSAGEANALYSIS_H
16#define CIRCT_DIALECT_SYNTH_ANALYSIS_RESOURCEUSAGEANALYSIS_H
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/StringMap.h"
49 for (
const auto &count : other.
counts)
50 counts[count.getKey()] += count.second;
83 void emitJSON(raw_ostream &os)
const;
This graph tracks modules and where they are instantiated.
Analysis that computes resource usage for Synth dialect operations.
igraph::InstanceGraph * getInstanceGraph() const
Get the instance graph used by this analysis.
DenseMap< StringAttr, std::unique_ptr< ModuleResourceUsage > > designUsageCache
Cache of computed resource usage per module.
ModuleResourceUsage * getResourceUsage(igraph::ModuleOpInterface module)
Get resource usage for a module.
igraph::InstanceGraph * instanceGraph
Instance graph for module hierarchy traversal.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Information about a child module instance.
InstanceResource(StringAttr moduleName, StringAttr instanceName, ModuleResourceUsage *usage)
ModuleResourceUsage * usage
Resource usage for a single module, including local and total counts.
SmallVector< InstanceResource > instances
ModuleResourceUsage(StringAttr moduleName, ResourceUsage local, ResourceUsage total)
const ResourceUsage & getLocal() const
const ResourceUsage & getTotal() const
ResourceUsage total
Resources including all child instances.
void emitJSON(raw_ostream &os) const
ResourceUsage local
Resources used directly in this module.
Resource usage counts for a set of operations.
ResourceUsage & operator+=(const ResourceUsage &other)
Accumulate resource counts from another ResourceUsage.
ResourceUsage(llvm::StringMap< uint64_t > counts)
llvm::StringMap< uint64_t > counts
const auto & getCounts() const