protected void constBranchEliminate(Block root) {
		Queue<Entry<Block, HashMap<Integer, SSAorConst>>> queue = new LinkedList<Entry<Block, HashMap<Integer, SSAorConst>>>();
		HashMap<Integer, SSAorConst> propagator = new HashMap<Integer, SSAorConst>();
		queue.add(new AbstractMap.SimpleEntry<Block, HashMap<Integer, SSAorConst>>(root, propagator));
		HashSet<Block> removedBlocks = new HashSet<Block>();

		while (!queue.isEmpty()) {
			Entry<Block, HashMap<Integer, SSAorConst>> entry = queue.remove();
			Block blk = entry.getKey();
			propagator = entry.getValue();
			if (blk == null) {// || visited.contains(blk)) {
				continue;
			}

			if (removedBlocks.contains(blk)) {
				// propagate removed message
				continueRemove(blk.getNextBlock(), queue, removedBlocks);
				continueRemove(blk.getNegBranchBlock(), queue, removedBlocks);
				continue;
			}
			// beggining
			propagator.putAll(blk.fixConstPhi(removedBlocks));
			// middle
			propagator = blk.copyPropagate(propagator);
			// end
			Block removed = blk.checkAndRemoveConstBranch();

			if (removed != null) {
				removedBlocks.add(removed);
				queue.add(new AbstractMap.SimpleEntry<Block, HashMap<Integer, SSAorConst>>(removed,
						null));
			}
			if (blk.getNextBlock() != null) {
				if (blk.getNextBlock().isBackEdgeFrom(blk)) {
					// back to front, update, but not propagate
					HashMap<Integer, SSAorConst> nextPropagator = new HashMap<Integer, SSAorConst>(
							propagator);
					// nextPropagator.putAll(blk.getNextBlock().fixConstPhi(removedBlocks));
					nextPropagator = blk.getNextBlock().copyPropagate(nextPropagator);
				} else {
					queue.add(new AbstractMap.SimpleEntry<Block, HashMap<Integer, SSAorConst>>(blk
							.getNextBlock(), propagator));
				}
			}
			if (blk.getNegBranchBlock() != null) {
				if (blk.getNegBranchBlock().isBackEdgeFrom(blk)) {
					// back to front, update, but not propagate
					HashMap<Integer, SSAorConst> nextPropagator = new HashMap<Integer, SSAorConst>(
							propagator);
					// nextPropagator.putAll(blk.getNegBranchBlock().fixConstPhi(removedBlocks));
					nextPropagator = blk.getNegBranchBlock().copyPropagate(nextPropagator);
				} else {
					queue.add(new AbstractMap.SimpleEntry<Block, HashMap<Integer, SSAorConst>>(blk
							.getNegBranchBlock(), propagator));
				}
			}
		}

	}