[Olena-patches] 2918: Revamp labeling::compute.