public void cloneInstrs(SimpleCloneInfo ii) { if (!isEmpty()) { List<Instr> oldInstrs = instrs; initInstrs(); for (Instr i: oldInstrs) { instrs.add(i.clone(ii)); } } // Rename the label as well! this.label = ii.getRenamedLabel(this.label); }
public void cloneInstrs(SimpleCloneInfo ii) { if (!isEmpty()) { List<Instr> oldInstrs = instrs; initInstrs(); for (Instr i: oldInstrs) { instrs.add(i.clone(ii)); } } // Rename the label as well! this.label = ii.getRenamedLabel(this.label); }
public void collapseStraightLineBBs() { // Collect cfgs in a list first since the cfg/graph API returns an iterator // over live data. But, basic block merging modifies that live data. // // SSS FIXME: So, we need a cfg/graph API that returns an iterator over // frozen data rather than live data. List<BasicBlock> cfgBBs = new ArrayList<>(); for (BasicBlock b: getBasicBlocks()) cfgBBs.add(b); Set<BasicBlock> mergedBBs = new HashSet<>(); for (BasicBlock b: cfgBBs) { if (!mergedBBs.contains(b) && outDegree(b) == 1) { for (Edge<BasicBlock> e : getOutgoingEdges(b)) { BasicBlock outB = e.getDestination().getData(); // 1:1 BBs can just be one since there is only one place to go. An empty entering any BB can merge // since the empty one does nothing (Note: mergeBBs uses empty as destination impl-wise but outcome // is the same). if (e.getType() != EdgeType.EXCEPTION && (inDegree(outB) == 1 || b.isEmpty()) && mergeBBs(b, outB)) { mergedBBs.add(outB); } } } } }
public void collapseStraightLineBBs() { // Collect cfgs in a list first since the cfg/graph API returns an iterator // over live data. But, basic block merging modifies that live data. // // SSS FIXME: So, we need a cfg/graph API that returns an iterator over // frozen data rather than live data. List<BasicBlock> cfgBBs = new ArrayList<>(); for (BasicBlock b: getBasicBlocks()) cfgBBs.add(b); Set<BasicBlock> mergedBBs = new HashSet<>(); for (BasicBlock b: cfgBBs) { if (!mergedBBs.contains(b) && outDegree(b) == 1) { for (Edge<BasicBlock> e : getOutgoingEdges(b)) { BasicBlock outB = e.getDestination().getData(); // 1:1 BBs can just be one since there is only one place to go. An empty entering any BB can merge // since the empty one does nothing (Note: mergeBBs uses empty as destination impl-wise but outcome // is the same). if (e.getType() != EdgeType.EXCEPTION && (inDegree(outB) == 1 || b.isEmpty()) && mergeBBs(b, outB)) { mergedBBs.add(outB); } } } } }
if ((bb == exitBB) && !bb.isEmpty()) {
if ((bb == exitBB) && !bb.isEmpty()) {
if (bb.isExitBB() && !bb.isEmpty()) {
if (bb.isExitBB() && !bb.isEmpty()) {