private void deleteUnreachableBlocks() {
    final IntList reachableLabels = new IntList(result.size());

    // subroutine inlining is done now and we won't update this list here
    resultSubroutines.clear();

    forEachNonSubBlockDepthFirst(
        getSpecialLabel(PARAM_ASSIGNMENT),
        new BasicBlock.Visitor() {

          @Override
          public void visitBlock(BasicBlock b) {
            reachableLabels.add(b.getLabel());
          }
        });

    reachableLabels.sort();

    for (int i = result.size() - 1; i >= 0; i--) {
      if (reachableLabels.indexOf(result.get(i).getLabel()) < 0) {
        result.remove(i);
        // unnecessary here really, since subroutine inlining is done
        // resultSubroutines.remove(i);
      }
    }
  }
Deletes all blocks that cannot be reached. This is run to delete original subroutine blocks
after subroutine inlining.
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/code/Ropper.java