if (!this.replaceGuide.shouldReplace(self)) { LinearPrinter.println(self + ": replacement doesn't decrease cost."); LinearPrinter.println(" stop."); return; }
    private void makeReplacement(SIRStream self, SIRIterator iter) {	if (!this.replaceGuide.shouldReplace(self)) {	    LinearPrinter.println(self + ": replacement doesn't decrease cost.");	    LinearPrinter.println(" stop.");	    return;	}	LinearPrinter.println("Creating linear replacement for " + self);	SIRContainer parent = self.getParent();	if (parent == null) {	    // we are done, this is the top level stream	    LinearPrinter.println(" aborting, top level stream: " + self);	    LinearPrinter.println(" stop.");	    return;	}	LinearPrinter.println(" parent: " + parent);	if (!this.linearityInformation.hasLinearRepresentation(self)) {	    LinearPrinter.println(" no linear information about: " + self);	    LinearPrinter.println(" stop.");	    return;	}		// generate a new implementation as a single filter	LinearFilterRepresentation linearRep;	linearRep = this.linearityInformation.getLinearRepresentation(self);	SIRStream newImplementation;	newImplementation = makeEfficientImplementation(parent, self, linearRep);	// remove the mappings from all of the children of this stream in our linearity information	// first, we need to find them all, and then we need to remove them all	HashSet oldKeys = getAllChildren(self);	// now, remove the keys from the linear representation (self is also a "child")	Iterator keyIter = oldKeys.iterator();	while(keyIter.hasNext()) {	    SIRStream currentKid = (SIRStream)keyIter.next();	    LinearPrinter.println(" removing child: " + currentKid);	    this.linearityInformation.removeLinearRepresentation(currentKid);	}	// all done.	// do the acutal replacment of the current pipeline with the new implementation	parent.replace(self, newImplementation);	// add a mapping from the new filter to the old linear rep (because it still computes the same thing)	this.linearityInformation.addLinearRepresentation(newImplementation, linearRep); // add same old linear rep    }