/** Remove all the predicates which are not defined in the hyperblock. */ private BitVect removePredicates(PredicateBlock start) { BitVect predicates = new BitVect(); Stack<Node> wl = new Stack<Node>(); // Determine all the predicates defined outside this hyperblock. start.nextVisit(); start.setVisited(); wl.add(start); while (!wl.isEmpty()) { PredicateBlock block = (PredicateBlock) wl.pop(); block.pushOutEdges(wl); for (Instruction inst = block.getFirstInstruction(); inst != null; inst = inst.getNext()) { if (inst.isMarker()) { continue; } if (inst.isBranch()) { continue; } if (((TripsInstruction) inst).definesPredicate()) { predicates.set(inst.getDestRegister()); } } } // Remove the predicates. start.nextVisit(); start.setVisited(); wl.add(start); while (!wl.isEmpty()) { PredicateBlock block = (PredicateBlock) wl.pop(); block.pushOutEdges(wl); if (!block.isPredicated()) { continue; } int rp = block.getPredicate(); if (predicates.get(rp)) { continue; } block.removePredicates(); for (Instruction inst = block.getFirstInstruction(); inst != null; inst = inst.getNext()) { inst.removePredicates(); } } return predicates; }