private static int doFuse(SIRPipeline pipe, int maxLength) {
private static int doFuse(SIRPipeline pipe, int maxLength, int maxElim) {
    private static int doFuse(SIRPipeline pipe, int maxLength) {	int numEliminated = 0;	int start = 0;	do {	    // find start of candidate stretch for fusion	    while (start < pipe.size()-1 && !isFusable(pipe.get(start))) {		start++;	    }	    // find end of candidate stretch for fusion	    int end = start;	    while ((end+1) < pipe.size() && isFusable(pipe.get(end+1))		   && (end-start+1<maxLength)) {		end++;	    }	    // if we found anything to fuse	    if (end > start) {		fuse((SIRFilter)pipe.get(start),		     (SIRFilter)pipe.get(end));		numEliminated += end-start;		start = start + 1;		System.err.println("Fusing " + (end-start+1) + " Pipeline filters!");	    } else {		start = end + 1;	    }	} while (start < pipe.size()-1);	// if pipe is down to a single filter and we're not at the	// toplevel already, then eliminate the pipeline	if (pipe.size()==1 && 	    pipe.get(0) instanceof SIRFilter &&	    pipe.getParent()!=null) {	    Lifter.eliminatePipe(pipe);	}	return numEliminated;    }