int prints = CheckPrint.check((SIRFilter)sink.contents);   if (prints == -1) { SinkUnroller.doit(sink); prints = CheckPrint.check((SIRFilter)sink.contents); } if (prints < 1) { System.out.println("Cannot generate number gathering code: Print(s) in control flow"); return false; }  System.out.println("Generating Number Gathering Code..."); Integer initInteger = (Integer)RawBackend.initExecutionCounts.get(sink); Integer steadyInteger = (Integer)RawBackend.steadyExecutionCounts.get(sink); int init = 0, steady = 0;  if (initInteger != null) init = initInteger.intValue(); if (steadyInteger != null) steady = steadyInteger.intValue();  if (steady < 1) { System.out.println ("Cannot generate number gathering code: Sink not called in Steady State"); return false; }   successful = true; skipPrints = init * prints; printsPerSteady = prints * steady; return true;
System.out.println("Cannot Generate Number Gathering Code.  Could not find a suitable sink..."); return false;
    public static boolean doit(FlatNode top)     {	successful = false;	sink = Sink.getSink(top);	//no sink or more than one sink	if (sink == null) {	    return false;	}	//the prints at the sink:	//no control flow	//in the work function	int prints = CheckPrint.check((SIRFilter)sink.contents);	// if we failed, unroll the filter on the loops that we	// indicated	if (prints == -1) {	    SinkUnroller.doit(sink);	    prints = CheckPrint.check((SIRFilter)sink.contents);	}	if (prints < 1) {	    System.out.println("Cannot generate number gathering code: Print(s) in control flow");	    return false;	}		System.out.println("Generating Number Gathering Code...");	Integer initInteger = (Integer)RawBackend.initExecutionCounts.get(sink);	Integer steadyInteger = (Integer)RawBackend.steadyExecutionCounts.get(sink);	int init = 0, steady = 0;		if (initInteger != null)	    init = initInteger.intValue();	if (steadyInteger != null) 	    steady = steadyInteger.intValue();		if (steady < 1) {	    System.out.println		("Cannot generate number gathering code: Sink not called in Steady State");	    return false;	}		//set the globals that are read by makefilegenerator		successful = true;	skipPrints = init * prints;	printsPerSteady = prints * steady;	return true;    }