while (haveBlock()) { OPT_BasicBlock curr = popBlock(); if (curr.scratch != 0) continue; if (DEBUG) VM.sysWrite("Checking to see if block "+curr+" is dead\n"); if (curr.hasZeroIn() || (curr.hasOneIn() && curr.pointsIn(curr))) {  curr.scratch = 0xdeadbeef; if (DEBUG) VM.sysWrite("\tremoving dead block "+curr+"\n"); for (OPT_BasicBlockEnumeration e = curr.getOut(); e.hasMoreElements(); ) { OPT_BasicBlock target = e.next(); if (target != curr && !target.isExit()) { OPT_SSA.purgeBlockFromPHIs(curr, target); pushBlock(target); } } ir.cfg.removeFromCFGAndCodeOrder(curr); } }
    final void perform (OPT_IR ir) {      OPT_GlobalValueNumberState gvns = ir.HIRInfo.valueNumbers;      OPT_DominatorTree dt = ir.HIRInfo.dominatorTree;      for (OPT_BasicBlockEnumeration bbs = ir.getBasicBlocks();	   bbs.hasMoreElements();) {	OPT_BasicBlock candBB = bbs.next();	OPT_Instruction candTest = candBB.firstBranchInstruction();	if (candTest == null) continue;	if (!(IfCmp.conforms(candTest) || InlineGuard.conforms(candTest))) continue;	OPT_GVCongruenceClass cc = gvns.congruenceClass(candTest);	if (cc.size() > 1) {	  for (Iterator e = cc.iterator(); e.hasNext();) {	    OPT_Instruction poss = (OPT_Instruction)((OPT_ValueGraphVertex)e.next()).name;	    if (poss != candTest) {	      if (dt.dominates(getNotTakenBlock(poss), candBB)) {		if (DEBUG) VM.sysWrite(candTest + " is dominated by not-taken branch of "+poss+"\n");		removeCondBranch(candBB, candTest, ir);		cc.removeVertex(gvns.valueGraph.getVertex(candTest));		break;	      } else if (dt.dominates(poss.getBranchTarget(), candBB)) {		if (DEBUG) VM.sysWrite(candTest + " is dominated by taken branch of "+poss+"\n");		takeCondBranch(candBB, candTest, ir);		cc.removeVertex(gvns.valueGraph.getVertex(candTest));		break;	      }	    }	  }	}      }    }