public int loopLevel(final Block block) {
		if (loopEdgeModCount != edgeModCount) {
			buildLoopTree();
		}

		if ((block == srcBlock) || (block.blockType() != Block.NON_HEADER)) {
			final LoopNode loop = (LoopNode) loopTree.getNode(block);
			Assert.isTrue(loop != null, "no loop for " + block);
			return loop.level;
		}

		if (block.header() != null) {
			final LoopNode loop = (LoopNode) loopTree.getNode(block.header());
			Assert.isTrue(loop != null, "no loop for " + block.header());
			return loop.level;
		}

		throw new RuntimeException();
	}