tensorflow / mlir-hlo
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 941 units with 16,463 lines of code in units (78.0% of code).
    • 13 very long units (1,574 lines of code)
    • 55 long units (3,620 lines of code)
    • 190 medium size units (5,792 lines of code)
    • 198 small units (2,892 lines of code)
    • 485 very small units (2,585 lines of code)
9% | 21% | 35% | 17% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc10% | 22% | 36% | 17% | 13%
h0% | 15% | 28% | 26% | 30%
cpp0% | 0% | 0% | 21% | 78%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/Dialect10% | 25% | 35% | 15% | 12%
lib/Analysis16% | 0% | 29% | 22% | 31%
include/mlir-hlo0% | 15% | 28% | 26% | 30%
lib/Transforms0% | 9% | 55% | 19% | 15%
lib/utils0% | 10% | 34% | 40% | 14%
lib/CAPI0% | 0% | 0% | 14% | 85%
tools/mlir-hlo-opt0% | 0% | 0% | 100% | 0%
python0% | 0% | 0% | 100% | 0%
python/mlir0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
145 29 3
LogicalResult matchAndRewrite()
in lib/Dialect/lhlo/transforms/lhlo_legalize_to_affine.cc
145 24 2
void visit()
in lib/Analysis/shape_component_analysis.cc
143 60 1
ParseResult parseReduceOp()
in lib/Dialect/mhlo/IR/hlo_ops.cc
137 52 2
ParseResult parseConvolutionDimensions()
in lib/Dialect/mhlo/IR/hlo_ops.cc
134 25 2
Value MaterializeZeta()
in lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo.cc
121 3 3
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
119 17 3
void runOnOperation()
in lib/Dialect/lhlo/transforms/lhlo_fuse_linalg.cc
118 33 0
static LogicalResult verifyReducerShape()
in lib/Dialect/mhlo/IR/hlo_ops.cc
106 23 8
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
102 14 3
LogicalResult TryLowerTo1DOr2DReduction()
in lib/Dialect/mhlo/transforms/group_reduction_dimensions.cc
102 26 6
void runOnOperation()
in lib/Dialect/mhlo/transforms/mhlo_canonicalize_reduction.cc
101 22 0
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
101 16 3
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
97 19 3
LogicalResult matchAndRewrite()
in lib/Dialect/lhlo/transforms/lhlo_legalize_to_gpu.cc
97 13 3
static LogicalResult Verify()
in lib/Dialect/mhlo/IR/hlo_ops.cc
89 23 1
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/lower_general_dot.cc
87 18 2
void populateHLOToLinalgConversionPattern()
in lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
86 1 3
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/rank_specialization.cc
85 17 2
LogicalResult matchAndRewrite()
in lib/Dialect/mhlo/transforms/optimize_mhlo.cc
85 21 2